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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Felix_nsama
New Member

Structured Financial Report-Subtotal - Power BI

I am trying to build a structured Financial Report with Traditional Struture ,so i have created a Dim -Report table with Report ID as key and includes sort order column )which is sharing a relationship with Chart of Accounts ReportID (lookup) . I written a measure using selectvalue and am able to get the figures by Expense code but no subtotals . What do I need to do to get sub-totals

2 ACCEPTED SOLUTIONS
Juan-Power-bi
Memorable Member
Memorable Member

The subtotal problem in financial reports is a classic Power BI challenge — SELECTEDVALUE only works at the detail row level, so when the visual renders the subtotal row, there's no single value selected and the measure returns blank.
The fix is to use ISINSCOPE to detect which level of the hierarchy you're at and calculate accordingly:
daxFinancial Amount =
IF(
ISINSCOPE('ChartOfAccounts'[ExpenseCode]),
-- Detail level: return the individual account amount
SELECTEDVALUE(...your existing logic...),
-- Subtotal/total level: sum all amounts in the current group
CALCULATE(SUM('FactTable'[Amount]))
)
The key insight is that at the subtotal row, ISINSCOPE('ChartOfAccounts'[ExpenseCode]) returns FALSE because you're no longer scoped to an individual expense code — you're at the Report Category level. So you can branch the logic: detail rows get your SELECTEDVALUE logic, and subtotal rows get a regular SUM that aggregates everything in the current filter context.
If your report structure has multiple levels (e.g., Category → Subcategory → Account), you'd nest multiple ISINSCOPE checks:
daxFinancial Amount =
IF(
ISINSCOPE('ChartOfAccounts'[ExpenseCode]),
[Detail Level Measure],
IF(
ISINSCOPE('DimReport'[SubCategory]),
[SubCategory Subtotal],
[Grand Total]
)
)
If some subtotals need to be calculated differently (e.g., Gross Profit = Revenue - Expenses rather than just summing children), you'd handle those specific rows with additional SELECTEDVALUE('DimReport'[ReportID]) checks inside the subtotal branch.

View solution in original post

danextian
Super User
Super User

Power BI matrix follows a hierarchy so a combination of conditional measures and a disconnected is normally needed to get the desired layout. The actual solution depends on the data. Below is an example result using such an approach. Notice that Gross Profit, Budget and Variance although expanded do not have anything under them.

danextian_0-1774331131004.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
v-pgoloju
Community Support
Community Support

Hi @Felix_nsama,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @danextian@Praful_Potphode  and @Juan-Power-bi  for prompt and helpful responses.

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

Hi @Felix_nsama

Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

danextian
Super User
Super User

Power BI matrix follows a hierarchy so a combination of conditional measures and a disconnected is normally needed to get the desired layout. The actual solution depends on the data. Below is an example result using such an approach. Notice that Gross Profit, Budget and Variance although expanded do not have anything under them.

danextian_0-1774331131004.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Praful_Potphode
Super User
Super User

Hi @Felix_nsama ,

 

Can you provide more information on input/output/dax code?

 

Thanks and Regards,

Praful

Juan-Power-bi
Memorable Member
Memorable Member

The subtotal problem in financial reports is a classic Power BI challenge — SELECTEDVALUE only works at the detail row level, so when the visual renders the subtotal row, there's no single value selected and the measure returns blank.
The fix is to use ISINSCOPE to detect which level of the hierarchy you're at and calculate accordingly:
daxFinancial Amount =
IF(
ISINSCOPE('ChartOfAccounts'[ExpenseCode]),
-- Detail level: return the individual account amount
SELECTEDVALUE(...your existing logic...),
-- Subtotal/total level: sum all amounts in the current group
CALCULATE(SUM('FactTable'[Amount]))
)
The key insight is that at the subtotal row, ISINSCOPE('ChartOfAccounts'[ExpenseCode]) returns FALSE because you're no longer scoped to an individual expense code — you're at the Report Category level. So you can branch the logic: detail rows get your SELECTEDVALUE logic, and subtotal rows get a regular SUM that aggregates everything in the current filter context.
If your report structure has multiple levels (e.g., Category → Subcategory → Account), you'd nest multiple ISINSCOPE checks:
daxFinancial Amount =
IF(
ISINSCOPE('ChartOfAccounts'[ExpenseCode]),
[Detail Level Measure],
IF(
ISINSCOPE('DimReport'[SubCategory]),
[SubCategory Subtotal],
[Grand Total]
)
)
If some subtotals need to be calculated differently (e.g., Gross Profit = Revenue - Expenses rather than just summing children), you'd handle those specific rows with additional SELECTEDVALUE('DimReport'[ReportID]) checks inside the subtotal branch.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.