Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

calculate subtotal for each category using measure

Hi All,

Below is my sample data,

RohiniP-26_1-1610014449798.png

 

 You may have seen this Structure in Microsoft Dynamics NAV in Chart of Accounts.

I need to create a trial balance report in Power BI. My Visual is a Table. I want to derive the last column (sum amount) as measure in my table visual. 

'Total' column represents the start and end range of 'No_'. I need to calculate the sum of amount (highlighted in red color) between the specified ranges in 'total' column.

Main category to sub-categories are:

1) Liabilities  & Equities

      i) Liabilities

            a) Loans

            b) General Reserves

      ii) Equities

            a) shares

To create a subtotal for each category , where the acoount type is specified as 'end total' using dax measure.

 

Thanks in Advance....

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found the solution,

Create another table (Master Table) without amount and date column (if you have it in same table).

Also should not give any relationship in model view.

And create the below measures there, 

total= CALCULATE(SUM('Table1'[Amount]),filter(values('Table1'[No_]), 'Table1'[No_] >= min('Master Table'[start range]) && 'Table1'[No_] <= max('Master Table'[end range])))

 

Sum Amount=sum(Table1[Amount]+[total])

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I found the solution,

Create another table (Master Table) without amount and date column (if you have it in same table).

Also should not give any relationship in model view.

And create the below measures there, 

total= CALCULATE(SUM('Table1'[Amount]),filter(values('Table1'[No_]), 'Table1'[No_] >= min('Master Table'[start range]) && 'Table1'[No_] <= max('Master Table'[end range])))

 

Sum Amount=sum(Table1[Amount]+[total])

 

amitchandak
Super User
Super User

@Anonymous , You have add additional column in table to group those. or do segmentation

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/

 

Refer this raditional Financial Statements

https://community.powerbi.com/t5/Desktop/Traditional-Financial-Statements/td-p/7223

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.