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
Marjukavic
New Member

Return data only if there are more than 6 records with filter

Hi,

 

I have a survey application, I need to create a report in PBI for the result with some filters (age, gender, title, civil status, etc.), but how to create a report that does not display data when the filter result is lower 6 records to not be able to identify who answered?

 

How to limit display of data to display only if it returns more than 6 records?

 

In SSRS I use the query:

 

Select *
From tb_questionario
Where
id_cargonivel in (@parameter1)
And id_tempoempresa in (@parameter2)
And id_idade in (@parameter3)
And id_sexo in (@parameter4)
And id_estadocivil in (@parameter5)
And id_grupofamiliar in (@parameter6)
And (Select count(id_cargonivel) From tb_questionario
Where 
id_cargonivel in (@parameter1)
And id_tempoempresa in (@parameter2)
And id_idade in (@parameter3)
And id_sexo in (@parameter4)
And id_estadocivil in (@parameter5)
And id_grupofamiliar in (@parameter6)) >= 6;

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

HI, @Marjukavic

      you may try to use ALLSELECTED Function to create a measure:

 

Measure = CALCULATE(COUNT(Table1[id_cargonivel]),ALLSELECTED(Table1[parameter1]),ALLSELECTED(Table1[parameter2]),ALLSELECTED(Table1[parameter3]),ALLSELECTED(Table1[parameter4]),ALLSELECTED(Table1[parameter5]),ALLSELECTED(Table1[parameter6]))

 and then drag it into the visual level filter and set filter >=6

 

8.PNG

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

HI, @Marjukavic

      you may try to use ALLSELECTED Function to create a measure:

 

Measure = CALCULATE(COUNT(Table1[id_cargonivel]),ALLSELECTED(Table1[parameter1]),ALLSELECTED(Table1[parameter2]),ALLSELECTED(Table1[parameter3]),ALLSELECTED(Table1[parameter4]),ALLSELECTED(Table1[parameter5]),ALLSELECTED(Table1[parameter6]))

 and then drag it into the visual level filter and set filter >=6

 

8.PNG

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lin,

 

Thank you so much, it worked.

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.