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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DebbieE
Community Champion
Community Champion

Counting Values less that a certain number. can I also include the slicers in the DAX

I have a visual whenre I add Number of People against Areas. If the total is less than wo I dont display it.

 

I have some DAX that counts the less than or equal to 10s

Is Area 10 or below = CALCULATE(sumx(VALUES('Dim Person'[Area]),IF('Fact'[Total People]<=10,1,BLANK())))
 
this works. However I have a Slicer on Year and Month from the date table set to 2024 January
And Another Slicer. Lets say' District. and this actually contains 20 areas.
On this I have a bar chart and I filter out anything under 10. 
 
I have a card showing the number of People in that group of under 10s. However the actual DAX is bringing back everything. ALL districts so im getting a lot of numbers.
 
I want the DaX toinclude the Date Year and district Slicer values so it only counts those related to the page. I have Tried ALL and ALLSELECTED but its just not working.
 
Has anyone got any ideas on how I could sort out the DAX above to include the slicers on the page?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DebbieE , Hope [Total People] is just a sum measure not using all or allselected. If all and all selected are not used then if the measure used anything other than area, then it will give data that will consider that row context too

 

based on what I got

 

so your total measure can be

= calculate(Count(Table[People]), filter(allselected(Dim Person), 'Dim Person'[Area] = Max('Dim Person'[Area]) ) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@DebbieE , Hope [Total People] is just a sum measure not using all or allselected. If all and all selected are not used then if the measure used anything other than area, then it will give data that will consider that row context too

 

based on what I got

 

so your total measure can be

= calculate(Count(Table[People]), filter(allselected(Dim Person), 'Dim Person'[Area] = Max('Dim Person'[Area]) ) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors