Forum Discussion

leandroduarte's avatar
2 years ago
Solved

Total per group

Dear Colleagues, I'm trying to make a total per group using this table structure, please let me know the best way to handle it

 

basically I want to display for each row the total of the group and year, not individual sum per type

 

YearGroupTypeQty Results Expected
2024AZ5000Group by A8200
2024AY3000Group by A8200
2024AI200Group by A8200
2024BI200Group by B200
2023AZ5000Group by A8000
2023AY3000Group by A3000
  • Hi leandroduarte 

     

    Download example PBIX file

     

    Use this measure

     

     

    Measure = CALCULATE(SUM('DataTable'[Qty]), FILTER(ALL('DataTable'), 'DataTable'[Group] = SELECTEDVALUE('DataTable'[Group]) && 'DataTable'[Year] = SELECTEDVALUE('DataTable'[Year])))

     

     

     

    Regards

     

    Phil

     

1 Reply

  • Hi leandroduarte 

     

    Download example PBIX file

     

    Use this measure

     

     

    Measure = CALCULATE(SUM('DataTable'[Qty]), FILTER(ALL('DataTable'), 'DataTable'[Group] = SELECTEDVALUE('DataTable'[Group]) && 'DataTable'[Year] = SELECTEDVALUE('DataTable'[Year])))

     

     

     

    Regards

     

    Phil