Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

how to pass value to a role from DAX Studio

I have a composite model, where my user's table is a direct query and the rest of the data is import. 

I would like to use DAX Studio to analyze the DAX performance by passing the user. 

 

Without "viewing as a user" I am able to get the visual back in 300 ms - 400 ms, but on the PBI Service when the user is viewing the same visual it is taking 200,000ms +, I am trying to analyze this using DAX studio so that I can break my measure in multiple pieces by adding/removing the complex logic. But, I am not able to find how I can run the measure definition in DAX Studio with the security as a user(role).

1 ACCEPTED SOLUTION
marcorusso
Most Valuable Professional
Most Valuable Professional

You need to be an admin of the Analysis Services engine to do this. Try to get the exact username to use by using Profiler as an admin. If you are using Power BI Desktop to test this, you might want to simulate this with a local username. If you are trying to connect to Power BI Service, I'm worried you cannot simulate another user because you are not an administrator.

If you use the Power BI Desktop feature to test a role, you can use the same technique. If you cannot test the role locally, you might be in trouble because you are not an administrator of the backend AS engine used by Power BI.

 

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

Best to ask @marcorusso. Is your RLS code complex? 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler: Thank you, for the reply.

For this report, RLS code is simple, just the volume of data going to SQL server and getting back and the summarizing, that being said I have some complex DAX in the measure (Ranking, sorting, grouping and sum)

marcorusso
Most Valuable Professional
Most Valuable Professional

Use Effective User Name in connection dialog box as explained here:

https://daxstudio.org/documentation/features/connection-dialog/

Anonymous
Not applicable

@marcorusso : Thank you, I did try adding the user, but I am getting error.

Maybe because of my security on the role us not with AD Account?

This report is embedded in a custom portal and I get the UserID from our custom portal.2020-04-07 03_41_59-DaxStudio - 2.10.1.png

 

marcorusso
Most Valuable Professional
Most Valuable Professional

You need to be an admin of the Analysis Services engine to do this. Try to get the exact username to use by using Profiler as an admin. If you are using Power BI Desktop to test this, you might want to simulate this with a local username. If you are trying to connect to Power BI Service, I'm worried you cannot simulate another user because you are not an administrator.

If you use the Power BI Desktop feature to test a role, you can use the same technique. If you cannot test the role locally, you might be in trouble because you are not an administrator of the backend AS engine used by Power BI.

 

Thanks @marcorusso figured you would be the person who would know!


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hmm, maybe it is something going on with the interaction between the two sets of DAX code. I wonder if you could emulate that interaction by combining the code in an evaluation statement in DAX Studio?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.