Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Measure Totals

ddd

 

Hello Community  -  First, I know there are several links that discuss wrong measure totals, and I have reviewed those.  

 

Using the measure below is giving me the correct row totals, but the wrong grand total.   How can I adjust to give the correct grand totals? 

 

Distinct Count of Rev Orders = CALCULATE( DISTINCTCOUNT( 'Flu_Shipped Orders'[Order] ), 'Flu_Shipped Orders'[Zero Value]="Revenue Shipments")

 

 

  • Please try this expression (replacing Table with your actual table name)

     

    Correct Totals = SUMX(VALUES(Table[Month]), [Distinct Count of Rev Orders])

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • You can use SUMMARIZE like a multi-column VALUES as follows

     

    Correct Totals = SUMX(SUMMARIZE(Table, Table[Month], Table[Make], Table[Category]), [Distinct Count of Rev Orders])

     

    Regards,

    Pat

4 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Please try this expression (replacing Table with your actual table name)

     

    Correct Totals = SUMX(VALUES(Table[Month]), [Distinct Count of Rev Orders])

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • Anonymous 

    In fact, the grand total calculates the distinct values correctly as it sees all the values without the month filter. But, each month distinct count would be different, We don't add distinct count by month.

    Hope it helps you.

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click on the Thumbs-Up icon on the right if you like this reply 🙂

    YouTube, LinkedIn

  • Anonymous's avatar
    Anonymous
    Not applicable

    mahoneypat - How will SUMX(VALUES) work if i want to get the correct total when there are multiple dimensions in the table. Like in this case we have only TABLE[CATEGORY] but if it has like CATEGORY, DATE, MAKE etc then how can we get the correct total?

     

    Here is the table and as you can see the totals are incorrect. Can you please help get correct totals?

     

    • mahoneypat's avatar
      mahoneypat
      Microsoft Employee

      You can use SUMMARIZE like a multi-column VALUES as follows

       

      Correct Totals = SUMX(SUMMARIZE(Table, Table[Month], Table[Make], Table[Category]), [Distinct Count of Rev Orders])

       

      Regards,

      Pat