Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculate Grand Total

Hello experts,

 

I would like to show the "Grand Total" of all these values on a pie chart 

Here's the code for the line, the other one is the same but with 2022

 

I created this measure : 

Mix CPNL 2021 = SUMX('BDD-MAJ 2021',[CPNL 2021])
 
But it don't work. What action or code should i use to display the grand total ?
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Please make sure where is month columns from in your line visual. 

    Try measure as below.

    Mix CPNL 2021 =
    SUMX ( VALUES ( 'TableName'[Month] ), [CPNL 2021] )

     

    Best Regards,
    Rico Zhou

     

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

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

    The pattern is:
    MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    etc.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sorry i didn't understand what you said.

       

      My line chart work perfectly but i want to add some bonus like the "grand total" 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please make sure where is month columns from in your line visual. 

    Try measure as below.

    Mix CPNL 2021 =
    SUMX ( VALUES ( 'TableName'[Month] ), [CPNL 2021] )

     

    Best Regards,
    Rico Zhou

     

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