This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
hi team , i need help ,
need to calculate sub total , i give the data and expected output
output
i try but it gives cumulative total only
Solved! Go to Solution.
Hi, @rajasekar_o
I'm happy to answer your questions. We can find the subtotal in the following two ways:
We can use measure to achieve the effect of finding subtotals:
Sample data:
DAX formula is as follows:
Total A.revenue = CALCULATE(SUM(Sheet5[Amt]),'Sheet5'[item] IN {"Revanue from opration","Other"})
Total B.cost = CALCULATE(SUM(Sheet5[Amt]),'Sheet5'[item] IN {"Cost of meirial","Purchase"})
We can use cards to reflect the effect:
Method 2, we can find the subtotal in power query:
First copy our table:
Remove first column:
pivot column:
Add custom columns:
replace null value:
Next, we unpivot the column:
Then we replace the value:
Finally we add the index column and rename it and move it to the first column:
Close power query and apply. I have provided my PBIX file below. If this helps you, that would be great
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @rajasekar_o
I'm happy to answer your questions. We can find the subtotal in the following two ways:
We can use measure to achieve the effect of finding subtotals:
Sample data:
DAX formula is as follows:
Total A.revenue = CALCULATE(SUM(Sheet5[Amt]),'Sheet5'[item] IN {"Revanue from opration","Other"})
Total B.cost = CALCULATE(SUM(Sheet5[Amt]),'Sheet5'[item] IN {"Cost of meirial","Purchase"})
We can use cards to reflect the effect:
Method 2, we can find the subtotal in power query:
First copy our table:
Remove first column:
pivot column:
Add custom columns:
replace null value:
Next, we unpivot the column:
Then we replace the value:
Finally we add the index column and rename it and move it to the first column:
Close power query and apply. I have provided my PBIX file below. If this helps you, that would be great
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rajasekar_o
In your table, create a calculated column
Category =
SWITCH(
TRUE(),
'TableName'[Column] IN {"Revenue from operation","Other Income"},"A.Revenue",
'TableName'[Column] IN {"Cost of material","Purchase"},"B.Expense")
use the column in 1st level row header in Matrix visual
If not work, please share sample of your exisiting data format, relationship
If solved, please mark as SOLUTION
Proud to be a Super User! | |
s.no | Amt | ||
| 1 | A.REVANUE | ||
| 2 | Revanue from opration | 9000 | |
| 3 | Other Income | 2000 | |
| 4 | B.EXPENCE | ||
| 5 | Cost of metirial | 30000 | |
| 6 | purchase | 35000 |
calculate total for A. REVENUE AND B.EXPENCE
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 62 | |
| 51 | |
| 31 | |
| 23 | |
| 23 |