Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am creating a PNL financial report using a visual Matrix. In one table I have month, amount ($), group and subgroup
how can I use DAX to insert a calculation in one of the groups that requires using totals from the above group values. For Example , total revenue and total expense to get gross profit. I tried using a switch case to allocate the measure to the line but getting blanks. Help please?!
I am Expecting a matrix table to look like this :
Measures:
Total Revenue = CALCULATE(SUM('Table1'[Amount]),'Table1'[GroupName] ="Revenue")
Total Expenses = CALCULATE(SUM('Table1'[Amount]),'Table1'[GroupName] ="Expenses")
Net Profit = [Total Revenue] - [Total Expenses]
Values_Measure = SWITCH(SELECTEDVALUE('Table1'[GroupName]), "Profit Before Tax", [Net Profit], CALCULATE(SUM('Table1'[Amount]))
Hi, @Sagejah9
Have your problem been solved? If not,Can you share some sample fake data? So we can help you soon.
Best Regards
Janey Guo
Hi @Sagejah9 ,
Please refer this link first to know how to get your query answered as you haven't provided much details:
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Thanks,
Pragati
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!