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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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