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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help with Slicers, and All function affecting totals for calculations.

Hi I hope someone can help.   I am trying to show the percentage of events from a total number of events once they have been affected by slicers.  Each row of data has a unique person ID, a LA, event "type", Age, gender code, and ethnicity codes.  The data is running from one main table, with the  UniqueID,  "event type", Age, and has look up tables to gender, Ethnicity.  

 

I  have set up the measure to "count the number ID's"  

ID's filtered = COUNT(main_flatcin[PersonID])
and the demoniator the total number of ID's below and divided them...

 

ALL  IDS =
CALCULATE(COUNT(main_flatcin[PersonID]),All(gender[Name]),All(Eth[Ethnicity Grp 1]),ALL(main_flatcin[Age (rounded)]),AlL(Eth[Ethnicity Description]))
 
I've set up the visual so it can show by one LA, and all the event types, and a slicer on ly affecting the chart on the right hand side where the event type can be selected and shows all LA's.    The total for this selection is 7471, but when I change the Age filter, it changes the total, and is not calculating the percentage correctly. 
 

emwf_0-1620037356514.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks both for your suggestions, unfortunately, these didn't work but I think it was the way my data was set up I created a new reference table, with unique ages and used that in the slicer, and change the All statement to include the column if that makes any sense. 

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Simple-ALL-function-not-working/m-p/905745

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks both for your suggestions, unfortunately, these didn't work but I think it was the way my data was set up I created a new reference table, with unique ages and used that in the slicer, and change the All statement to include the column if that makes any sense. 

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Simple-ALL-function-not-working/m-p/905745

 

 

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Or try this.

 

ALL  IDS =
CALCULATE(COUNT(main_flatcin[PersonID]),AllSELECTED(gender[Name]),AllSELECTED(Eth[Ethnicity Grp 1]),AllSELECTED(main_flatcin[Age (rounded)]),AllSELECTED(Eth[Ethnicity Description]))

 

Best regards,
Lionel Chen

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

 

amitchandak
Super User
Super User

@Anonymous , try all IDS like

CALCULATE(COUNT(main_flatcin[PersonID]),All(gender),All(Eth),ALL(main_flatcin))

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.