intelequia / dnn.powerbiembedded

A set of modules to embed Power BI workspaces in a DNN Platform portal through Power BI Embedded
MIT License
11 stars 2 forks source link

Token value is not render in Power Bi report #17

Open CodergenixDeveloper opened 1 year ago

CodergenixDeveloper commented 1 year ago

We use Power BI Report In the DNN web for display report

DNN Framework version - 09.08.01 Power Bi report Version - 1.0.22 https://github.com/intelequia/dnn.powerbiembedded/releases/tag/v1.0.22

I am trying to display current DNN web LoggedIn user name in Power Bi report using Replacement Tokens using [User:Username] this Token https://docs.dnncommunity.org/content/tutorials/references/replacement-tokens/index.html

image

Please see in image, [User:Username] Token render in HTML module, but it is not render in powerBI report

Also I checked all values of User property dropdown but still failed image

davidjrh commented 1 year ago

Hi @CodergenixDeveloper,

If what you achieve is to show the logged user name on that table, you should use the DAX function "username()" so you can use the User property value passed from the DNN PowerBI Module.

To easily check the value that DNN is passing to PowerBI, you can add the Username to your model, as described in this post https://powerbi.microsoft.com/en-gb/blog/using-username-in-dax-with-row-level-security/

So for example, in your case:

  1. Set the "User Property" to "Username" in the module settings (is the default value)
  2. Add the table "User = username()" to your model
  3. Use that table where you want.
CodergenixDeveloper commented 1 year ago

Hi @davidjrh

Thank you for your response

I checked using username() and userprincipalname() but it is return power bi logged user account username.
https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

i need to get and use DNN web logged user username in power Bi report. image

I need "Host" username in report but username() return "developer@co.com" username ps. "developer@co.com" is my app.powerbi.com portal login user. which i used for login

davidjrh commented 1 year ago

Is your report setup for using RLS? That parameter is only passed to the report if the report has RLS enabled. To test, create the role "Registered Users" and test again.

image