Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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 | Amount 1 | Amount 2 | Amount 3 | Amount 4 |
Gross | 50000 | 30000 | 20000 | 15000 |
Spend | 5000 | 3000 | 2000 | 1500 |
And I'd the Matrix Visualisation to look like.
Budget Type | Amount 1 | Amount 2 | Amount 3 | Amount 4 |
Gross | 50000 | 30000 | 20000 | 15000 |
Spend | 5000 | 3000 | 2000 | 1500 |
Net | 45000 | 27000 | 18000 | 13500 |
So the Net = Gross - Spend. Is there an easy wasy to achieve this?
Many Thanks.
Solved! Go to Solution.
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
54 | |
38 | |
31 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |