Power BI Exchange

Expand all | Collapse all

Show slicer selection based on user for non Power BI users(Embedded power BI)

  • 1.  Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-12-2018 12:27 AM
    Hi,

    We are using embedded power BI on our application with one pro account to publish the reports/dashboards.
    I have a slicer with list of companies. When user 1 logs on to our application and launches the dashboard/report, I want to display just the companies for which he has access set on our application, other users should also see only the companies for which they have access.
    Our users do not have a pro license, they are external to our organization, and we are not on premium capacity. Is it still possible to enable access based on our requirement? I'd like to avoid creating multiple reports per user.

    Thanks

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------


  • 2.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-13-2018 10:14 AM
    Row level security is available when using Power BI Embedded. This would be the best way to limit each user's view of the data dynamically and in a secure way.
    Use row-level security with Power BI embedded content - Power BI
    Microsoft remove preview
    Use row-level security with Power BI embedded content - Power BI
    Learn about the steps you need to take to embed Power BI content within your application.
    View this on Microsoft >




    ------------------------------
    David Pugh
    Principal Solution Architect
    CDW
    ------------------------------



  • 3.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Silver Contributor
    Posted 06-13-2018 04:05 PM
    Shilpa, you may not have a (P)remium account but you will still need a dedicated capacity such that non Power BI users (free) can access your Power BI Embedded app. So you will need either an (A)zure license or an O365 (EM)bedded license to get the dedicated capacity ....that way you can create a 'dedicated' workspace to host your app reports/tiles/dashboards for which you will need an embedtoken for PBIEmbedded to function as you require.

    ------------------------------
    David Moss
    Advanced Analytics & Power BI Azure Solutions
    Wottabyte
    London
    ------------------------------



  • 4.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-14-2018 09:49 AM
    Thanks @David Moss When you say Azure License, we already use Azure pay-as-you-go subscription for our SQL licenses, we plan to avail the A1 capacity for embedded Power BI. Will this suffice to enforce the security I am looking for? All documentation I am seeing refers to users having pro licenses, but I'd want to avoid this, we have about 1000 users. All they need is consume dashboards for the companies they have access to.

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------



  • 5.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Silver Contributor
    Posted 06-14-2018 06:35 PM
      |   view attached
    @Shilpa Vishwanath YES it will.....Prices in GBP Sterling using your Azure PAYG subscription purchase an Azure Power BI Embedded A1 (see picture) license. This along with your 1 developer PBI Pro license will permit your PBI developer to publish his .pbix with Row Level Security (RLS) configured on the dimension 'companies by user'. This architecture will permit you then to use the Power BI Embedded (PBIE) 'App owns Data' model for your external non power bi users to only see the companies they have permissions on.
    Of course this is a PaaS and needs some developer integration of the PBIE into your current app. This includes authenticating your app with AAD, getting an accesstoken and then creating an embedtoken with an EffectiveIdentity.
    I hope that helps yoru research...feel free to ask more if you need....David   ​

    ------------------------------
    David Moss
    Advanced Analytics & Power BI Azure Solutions
    Wottabyte
    London
    ------------------------------



  • 6.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-20-2018 09:43 AM
    Thanks for your suggestion @David Moss I will get back if I run into issues while doing this.​

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------



  • 7.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-21-2018 06:07 PM
    @David Moss The approach you provided seem to work partially for us. Maybe we are missing some detail on our code. Here is what we did:
    1) We availed the A1 node, and turned on the 'dedicated capacity' after assigning this node to our app workspace​.
    2) Created a user in AAD as a 'member' and added this user to the app workspace as a 'member'
    3) Created RLS for one of the companies and assigned this user the the role.
    4) We are receiving a 403 Forbidden error while generating the dataset. generating the embedded token and getting the report seems to work, but retrieving the dataset is throwing an rror.

    We tried changing the user as admin on the app workspace. This did not generate the 403 Forbidden error but RLS did not apply and user was able to see all the companies.

    Here is the snippet of code we are using and seeing the error at var datasets line

    var reports = client.Reports.GetReportsInGroupAsync(GroupId).Result;
    var report= string.IsNullOrEmpty(ReportId)
    ? reports.Value.FirstOrDefault()
    : reports.Value.FirstOrDefault(r => r.Id == ReportId); ;

    if (report == null)
    {
    result.ErrorMessage = "Group has no reports.";
    //return View(result);
    }

    var datasets = client.Datasets.GetDatasetByIdInGroupAsync(GroupId, report.DatasetId).Result;
    result.IsEffectiveIdentityRequired = datasets.IsEffectiveIdentityRequired;
    result.IsEffectiveIdentityRolesRequired = datasets.IsEffectiveIdentityRolesRequired;
    var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view");

    Any suggestions would help.

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------



  • 8.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-21-2018 07:37 PM
    @David Moss We were able to get past the 403 error, but RLS does not seem to apply for the user when embedding into our application. Any suggestions on what we may be missing?
    Also, is it necessary to turn on the 'dedicated capacity' inspite of using the A1 instance type? We want to avoid using the Premium option​

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------



  • 9.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-22-2018 09:30 AM
    Edited by James Arey 06-22-2018 09:30 AM
    Shilpa, it sounds like you are using App Owns Data to embed content in your application. If this is the case then you won't be able to add users to roles in Power BI, you will have to pass the Username and Roles when generating your Embed Token. So instead of applying Users to Roles in the Power BI Service, you will create the Roles in the Service then your application will determine which Roles to apply by which user is logged in.

    https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security#applying-user-and-role-to-an-embed-token

    ------------------------------
    James Arey
    ------------------------------



  • 10.  RE: Show slicer selection based on user for non Power BI users(Embedded power BI)

    Posted 06-22-2018 05:07 PM
    @James Arey Thanks ! Your solution worked perfectly :)​

    ------------------------------
    Shilpa Vishwanath
    Architect, Business Intelligence
    Intelligent Hospitality
    ------------------------------