Forum Discussion

freginier's avatar
freginier
Icon for Solution Sage rankSolution Sage
4 years ago
Solved

Repeat result sum on all rows

Hi all, 

 

I have this kind of table :

CategoryProjectAmount
CAT1Project110
CAT1Project220
CAT2Project330
CAT3Project4

40

CAT3Project5

50

 

I want to summurize CAT3 and repeat the value for all rows but I want don't display CAT3. 

Result expected :

CategoryProjectAmountCAT3
CAT1Project11090
CAT1Project22090
CAT2Project330

90

 

How can I do this with DAX ? 

 

Thank you ! 

  • Use this measure:

    CAT3 value = CALCULATE (SUM(Table[Amount]), Table[Category] = "CAT3")

2 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    Use this measure:

    CAT3 value = CALCULATE (SUM(Table[Amount]), Table[Category] = "CAT3")

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi freginier ,

     

    Create a measure as below :-

    Measure =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Category] = "CAT3" )
    )
    

    and now add filter as below on your visual:-