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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Community Champion
Community Champion

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!:
DAX For Humans

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!:
DAX For Humans

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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors