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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Column calculated based on multiple row values

Good

I'm pretty inexperienced in Power BI, I apologize in advance. If the example is too extensive, it is also worth having a guide of possible functions to use, et.c.

I have two tables, one for users and one for permissions assigned to users. For example:

Users:

IdUsuarioNumber
1

Marten

2Anselmo
3Roberto
4Maria
5Andrew

Permissions (it does not have to be ordered like this):

idUsuarioPermission
1 Reading
2 Reading
3 Reading
4 Reading
2Creation
3Creation
4Creation
3Modify
4Modify
4Erase

What I'm looking for is to add to the Users table a column called "user type" depending on their permissions:

- If you only have "Reading" = "Reader"

- If you have "Creation" = "Creator"

- If you have "Creation" + "Modification" = "Editor"

- If you have all 4, let it be "Administrator"

- If none of the above is met = "Not classified"

In the example the result would be like this:

IdUsuarioNumberUser Type
1

Marten

Reader
2AnselmoCreator
3RobertoEditor
4MariaManager
5AndrewUnrated

Thank you so much

Jose

Thank you!

6 REPLIES 6
mangaus1111
Solution Sage
Solution Sage

Hi @Syndicate_Admin ,

sorry, I am not able to answer to your second question. Maybe if you send me a sample of this intermediate table, I could better imagine what is an alternative solution.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello

Thanks for the quick response. I can think of something like this:

ReadingCreationModificationEraseUser Type
X Reader
XX Creator
XXX Editor
XXXXManager

Thank you

Jose

Hi @Syndicate_Admin ,

it seems to me that your new table does not help to improve the model. What your table do, it is setting the rules, but the rules are already inside my measure.

To improve the model, I suggest you to use this other measure that takes into account all the possible combinations of permissions, for example if you need 2 different kind of Editor

Measure 2 = 
SWITCH(
       MAX('Final Table'[Path]),
       "Reading","Reader",
       "Reading|Creation","Creator",
       "Reading|Modify","Editor Level I",
       "Reading|Creation|Modify","Editor Level II",
       "Reading|Creation|Modify|Erase","Manager",
       "Not classified"  
)

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Syndicate_Admin
Administrator
Administrator

Hello

This solution is only for this case where each level has a different number of permissions (1, 2, 3, 4) than the others. What happens is that my case is more complex than this, that I simplified it.

Couldn't it be done with an intermediate table where I define what permissions have to have what level?

Thank you

mangaus1111
Solution Sage
Solution Sage

Hi @Syndicate_Admin ,

see my pbi file. Let me know if the link does not work

https://1drv.ms/u/s!Aj45jbu0mDVJiy_rTxR-3EUpINAo?e=G44uKS

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello

This solution is only for this case where each level has a different number of permissions (1, 2, 3, 4) than the others. What happens is that my case is more complex than this, that I simplified it.

Couldn't it be done with an intermediate table where I define what permissions have to have what level?

Thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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