Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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. 
 

 

3 Replies

  • Anonymous , try all IDS like

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

  • v-lionel-msft's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity 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.