Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |