Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have several reports using Roles to hide sensitive date. Each table with the sensitive data contains a column with the customer name called "CustomerSource" so only that customer should see the information in that row. I want a quick and easy way to validate the roles across several reports.
My ideal solution would be a hidden tab that has a matrix/table with a column for every table with a CustomerSource column and then it would list the distinct values in that column like this:
Table 1 | Table 2 | Table 3 | Table 4 | Table 5 |
Customer 1 | Customer 1 | Customer 1 | Customer 1 | Customer 1 |
Customer 2 | Customer 2 | Customer 2 | Customer 2 | Customer 2 |
Customer 3 | Customer 3 | Customer 3 | Customer 3 | Customer 3 |
Customer 4 | Customer 4 | Customer 4 | Customer 4 | Customer 4 |
Then when I view as a role (e.g. Customer1Role) if it was working it would only show Customer 1 in the table like this:
Table 1 | Table 2 | Table 3 | Table 4 | Table 5 |
Customer 1 | Customer 1 | Customer 1 | Customer 1 | Customer 1 |
Or if there was an issue it would show more values than intended:
Table 1 | Table 2 | Table 3 | Table 4 | Table 5 |
Customer 1 | Customer 1 | Customer 1 | Customer 1 | Customer 1 |
Customer 2 | ||||
The issue is that I want to be able to quickly build this visual out in multiple reports. Is there a way with DAX to check every table for a certain column name and then display those values?
Solved! Go to Solution.
Hi, @taylorb
According to your description, I guess you want to get a table that displays the [CustomerSource] column in the five tables, and the value should be the user who views this report. I think you can not achieve this in a simple DAX, you can create measures for each table to get the expected result, you can take a look at my steps:
Table1 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table1',[CustomerSource]=USERPRINCIPALNAME()))
Table2 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table2',[CustomerSource]=USERPRINCIPALNAME()))
Table3 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table3',[CustomerSource]=USERPRINCIPALNAME()))
Table4 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table4',[CustomerSource]=USERPRINCIPALNAME()))
Table5 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table5',[CustomerSource]=USERPRINCIPALNAME()))
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @taylorb
According to your description, I guess you want to get a table that displays the [CustomerSource] column in the five tables, and the value should be the user who views this report. I think you can not achieve this in a simple DAX, you can create measures for each table to get the expected result, you can take a look at my steps:
Table1 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table1',[CustomerSource]=USERPRINCIPALNAME()))
Table2 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table2',[CustomerSource]=USERPRINCIPALNAME()))
Table3 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table3',[CustomerSource]=USERPRINCIPALNAME()))
Table4 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table4',[CustomerSource]=USERPRINCIPALNAME()))
Table5 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table5',[CustomerSource]=USERPRINCIPALNAME()))
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This looks great, thank you
User | Count |
---|---|
140 | |
113 | |
104 | |
73 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |