Forum Discussion

berta2b's avatar
berta2b
Helper I
9 years ago
Solved

Power BI desktop create a Calculated Row in Matrix Visualisation

Hi guys, I'm new to PBI Desktop and DAX functions and I'd like to create a calculated row with columns which are the result of subtracting two previous columns. Here is my dataset.   Budget Type...
  • v-haibl-msft's avatar
    9 years ago

    berta2b

     

    Please try to create two tables with following DAX formulas.

    NetTable = SUMMARIZE( Table1, "Budget", "Net", 
        "Amount1", CALCULATE( SUM( Table1[Amount1] ), Table1[Budget Type] = "Gross" ) - CALCULATE( SUM( Table1[Amount1] ), Table1[Budget Type] = "Spend" ),
        "Amount2", CALCULATE( SUM( Table1[Amount2] ), Table1[Budget Type] = "Gross" ) - CALCULATE( SUM( Table1[Amount2] ), Table1[Budget Type] = "Spend" ),
        "Amount3", CALCULATE( SUM( Table1[Amount3] ), Table1[Budget Type] = "Gross" ) - CALCULATE( SUM( Table1[Amount3] ), Table1[Budget Type] = "Spend" ),
        "Amount4", CALCULATE( SUM( Table1[Amount4] ), Table1[Budget Type] = "Gross" ) - CALCULATE( SUM( Table1[Amount4] ), Table1[Budget Type] = "Spend" )
    )

     

    Table2 = UNION( Table1, NetTable )

     

    Best Regards,

    Herbert