Search code examples
reportpowerbidax

How to create custom "summary/total" of a table


Say I have a table:

category    amount    
 A           10
 B           15
 C           20
 D           35
 E           10
 TOTAL       90

and I create a measure which is the sum of E & D minus the sum of A & B.

and I call this measure the my_total.

Now I would want the table to look like:

category    amount    
 A           10
 B           15
 C           20
 D           35
 E           10
 my_total    10

I can easily create this measure, and I have. but how can I edit the "summary or total" section of my table to do a custom calculation, using a custom row name?


Solution

  • Try:

    my_measure = 
        IF ( 
            HASONEFILTER ( MyTable[category] ),
            SUM ( MyTable[amount] ),
            [my_total]
        )
    

    Worked example PBIX file: https://pwrbi.com/so_55377007/