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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jortega023
Regular Visitor

applying filters with minimum sample size

Hi!

 

I am working on survey results with multiple filters in Power BI and I am concerned about protecting the confidentiality of respondents.

 

Applying a filter in a question, if the number of respondants is less than 5, the output wouldn't be visible.

 

In example:

 

RespondantCity 
TonyNew York
PeterNew York
BruceMiami
NickMiami
StevenMiami
NataliaMiami
StanMiami
GrootMiami
LoganMiami
Mary JaneMiami

 

Applying a filter for the column "City: New York", no results would be visible in the graphic, because there is only 2 people for that city) 

 

Is there an easy way to do that? I was trying to do a measure using IF functions, but i´m not getting the results I was looking for.

 

Thanks in advance!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@jortega023 

 

How about using a MEASURE as visual filter for the Table Visual.

In Visual Filter you can choose not equal to 1

MeasureforVisualFilter =
IF (
    CALCULATE ( COUNTROWS ( tableName ), ALLEXCEPT ( tableName, TableName[City] ) ) < 5,
    1
)

Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@jortega023 

 

How about using a MEASURE as visual filter for the Table Visual.

In Visual Filter you can choose not equal to 1

MeasureforVisualFilter =
IF (
    CALCULATE ( COUNTROWS ( tableName ), ALLEXCEPT ( tableName, TableName[City] ) ) < 5,
    1
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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