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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dkrishnan
Frequent Visitor

Display measure by User role

Hi All

 

Thanks in advance to your help.

 

I have two fields as measured value. I want to show a single value on charts or tables based on the user. Example, if user A logged in, then i would like to show Actual_amount and if user B logged in, i want to show Blended_amount. Currently i have to create 2 different .pbi file which i have to maintain to show two different dataset. I would like to maintain one file only having able to display information based on user and role.

 

 

CALL_DATEACTUAL_AMOUNTBLENDED_AMOUNT
01-JAN-202010080
02-JAN-2020120100
03-JAN-2020150130
2 REPLIES 2
dm-p
Super User
Super User

Hi @dkrishnan,

If you literally have two users and one measure to worry about then you can write a measure that does a check on USERNAME, e.g.:

    IF(
        USERNAME() = "USERA", SUM(Data[ACTUAL_AMOUNT]),
        SUM(Data[BLENDED_AMOUNT])
    )

But this is not maintainable if more users or roles need to be taken into consideration. In which case, you should use row level security and some modelling changes to dynamically handle measures.

BI Elite has an awesome walkthrough on this and explains it better than I can in a forum post.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi

 

Thanks for the input. I have a rough idea based on the video link you sent. I already implemented the selected measures. I will need to tag the roles and test them. Will keep you posted.

 

regards

deven

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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