Reputation: 1592
What options are there in PowerBI to suppress, redact or hide values to anonymise values in reports and visuals without loosing detail and have that restriction apply to multiple pages in a report?
Cat | Count | % |
---|---|---|
Category 1 | 23 | 10 |
Category 2 | 2 | 0.9% |
Category 3 | 4 | 1.7% |
So that its possible to keep the rows but end up with a placeholder where count is <4 and % is greater than 1% but less than 2%
Cat | Count | % |
---|---|---|
Category 1 | 23 | 10 |
Category 2 | * | 0.9% |
Category 3 | 4 | * |
So far my experience has been
I also want to be clear when a value has been suppressed or masked
I suspect there is a more better way but I haven't been able to figure out where to even start.
Upvotes: 2
Views: 2457
Reputation: 808
It depends on your data connection type as to whether this is available, but a calculated column (instead of a measure) can be used as a filter at the "this page" or "all pages" level.
If this option is available, then you can find it right next to the "New Measure" field.
Using this and your sample data above, I created a couple of calculated columns and show the resulting table. You can then display these columns and use them as filters throughout the report. Your DAX may be slightly different depending on how the actual data is formatted and such.
Count Calculated Column
Masked Count =
IF(
'Table'[Count] < 4,
"*",
CONVERT('Table'[Count], STRING)
)
% Calculated Column
Masked % =
IF(
'Table'[%] > .01 && 'Table'[%] < .02,
"*",
CONVERT('Table'[%] * 100, STRING) & "%"
)
Resulting Table
Example of how the filter can be used
The values of these columns will update as your data source is refreshed in Power BI. However, calculated columns aren't available for Live Connection, in which case you would have to do this kind of logic at a lower level (in Analysis Services for example).
Additionally, you could potentially use Power Query Editor to accomplish this kind of thing.
Upvotes: 1
Reputation: 30289
OK, I have something working but you will need Tabular Editor to create a calculation group. Here are the steps.
Add two measures (calculation groups only work on measures) as follows.
% Measure = SUM('Table'[%])
Count Measure = SUM('Table'[Count ])
Open tabular editor and create a new calculation group named "CG" with a calculation item named "Mask". Paste the following code into the calculation item.
if ( (selectedmeasurename() = "% Measure" && selectedmeasure() >1 && selectedmeasure() <2) || (selectedmeasurename() = "Count Measure" && selectedmeasure() <4) ,"*",selectedmeasure() )
4. Save the calculation group and in Power BI drag the name column onto the filter for all pages as follows, ensuring it is selected:
Upvotes: 1