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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RohiniP-26
Resolver I
Resolver I

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
RohiniP-26
Resolver I
Resolver I

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
RohiniP-26
Resolver I
Resolver I

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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