Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Good afternoon,
I have two tables: a sales table and a table with some data to filter the sales table. This architecture is a must.
The idea is to filter the sales table depending on the filter applied on the permission table, which gets automatically filtered when starting the report.
SALES TABLE
# | Price | User | Shop
1 | 10 € | A | Paris
2 | 12 € | A | Bordeaux
3 | 11 € | B | Rome
4 | 10 € | C | Paris
PERMISSION TABLE
USER | ACCESS | TYPE
A | A | user
B | B | user
C | C | user
C | Paris | shop
So that user A would see sale n1 and sale n2. User B would see sale n3 and user C would see sale n1, sale n4.
The idea is to calculate it dinamically. Thus, I need this to be done on DAX with a measure. I was thinking to calculate an "X" if the user or the shop is found in the permission table, and filter the sales table by "X".
Any idea on how to do this?
I cannot use a DAX table due to the fact that it needs an update of the report to get updated.
Thank you so much!
Solved! Go to Solution.
Hi @colacan
I finally did it with the following measure:
It is strongly recommended to make the the permission table has unique user. it is to prevent any unexpected error in the future as well. if you can not change exisitng permission table, it's better to create one and relates it to both sales table and existing table as 1:m (in case you need exisitng permission table in the future)
How could I do a user to see his sales & the sales of the shops he owns? thanks!
@mizaskun Hi, based on your sample data (I have to depend on it to answer your question since this is the only source with which I can understand your issue) I can see the shop is in the sales table already. in that can each user can see their number by shop by simply adding Sales[shop] in the visual as below;
Hi @colacan
I finally did it with the following measure:
@mizaskun Hi,
I assume the permission table and sales table is related as 1:m by the User
If I explain based on your table, you may create basic mearues which you need, like sum of price or average price
The relation is **, many to many. Any other way to achieve this?
Thanks!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
17 | |
17 | |
15 |
User | Count |
---|---|
28 | |
27 | |
18 | |
14 | |
13 |