web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Filter power bi report...
Power Pages
Unanswered

Filter power bi report in power pages site on accountnumber

(0) ShareShare
ReportReport
Posted on by 39
Hello experts,
 
I have a power bi report in my portal. I want to filter the report on Accountnumber. So when a person is logged-in he only sees the data that is connected to the Account he is assigned to.
 
Can someone help me out with this? 
 
Thank you
 
Categories:
I have the same question (0)
  • SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    Hi  ,
     
    Use Row-Level Security (RLS) in Power BI combined with Power Pages security. Here’s how you can set this up:
     
    Open your Power BI report in Power BI Desktop. Go to the Modeling tab and select Manage roles. Create a new role (e.g., "AccountFilter"). Apply a DAX filter on the table containing account data. For example: [AccountNumber] = USERPRINCIPALNAME() Publish the Report to Power BI Service:

    Embed the Report in Power Pages: Add the Power BI report to your Power Pages site using the Power BI Embedded component or an iframe with an embed link. Use the Power Pages Design Studio or custom HTML/JavaScript to embed the report.

    Enable Single Sign-On (SSO): Configure SSO between Power BI and your portal using Azure AD authentication. This ensures the logged-in user's identity is passed to Power BI for RLS.

    In Power Pages, fetch the user's assigned AccountNumber using Liquid templates or JavaScript. {% assign accountNumber = user.accountnumber %}

    Use the Power BI JavaScript API to pass the AccountNumber dynamically to the report. let models = window['powerbi-client'].models;
    let config = {
      type: 'report',
      embedUrl: 'https://app.powerbi.com/...yourReportEmbedUrl...',
      accessToken: 'yourAccessToken',
      settings: {
        filterPaneEnabled: false,
        navContentPaneEnabled: false
      }
    };

    // Apply filter on AccountNumber
    let accountFilter = {
      $schema: "http://powerbi.com/product/schema#basic",
      target: {
        table: "YourTableName",
        column: "AccountNumber"
      },
      operator: "In",
      values: ["{{ accountNumber }}"]
    };
    let reportContainer = document.getElementById('reportContainer');
    let report = powerbi.embed(reportContainer, config);
    report.on("loaded", function() {
      report.setFilters([accountFilter]);
    });
     
    try out

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard