Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi everyone,
I'm struggling with a DAX filtering logic where I need to exclude a specific sub-segment value from one calculation path without affecting the other.
The Context: I have a report with a toggle between two main views: Insurance and Other. This is controlled by a calculated column that groups my sub-segments.
The Calculated Column:
Sub_Segment_grouped2 =
IF (
'Subsegment'[Sub_Segment] IN { "Health", "P&C", "Life", "Equity" },
"Insurance",
"Other"
)
The Current Measures: I use a dynamic "Stack" measure to switch between the views:
Total Profit before tax - Stack Dynamic =
VAR subSeg = SELECTEDVALUE ( 'Subsegment'[Sub_Segment_grouped2] )
RETURN
SWITCH (
subSeg,
"Insurance", [Total Profit before tax - Stack insurance],
"Other", [Total Profit before tax - Stack Other],
BLANK()
)
The Problem: In my data, "Equity" is technically mapped to "Insurance" (as seen in my calculated column). However, when the user selects the "Other" view, the visual still aggregates data where Sub_Segment = "Equity" into the "Other" totals/visuals because of the underlying filter context.
Goal: When Sub_Segment_grouped2 is "Other", I want to explicitly exclude/subtract any data where Sub_Segment = "Equity".
Requirement: This must NOT affect the "Insurance" view.
Example: For a specific company, the "Other" view currently shows 34M. 15M of that is "Equity". I want the "Other" view to show only 19M (34-15), while the "Insurance" view remains untouched.
I've tried wrapping the SWITCH in a CALCULATE with a filter, but it's not producing the expected result in the stacked bar chart.
How can I modify Total Profit before tax - Stack Other to strictly ignore the "Equity" sub-segment regardless of the grouping?
Hi
I see the fix is straightforward,just add the Equity exclusion directly inside your Total Profit before tax - Stack Other measure using CALCULATE with a filter:
daxTotal Profit before tax - Stack Other =
CALCULATE(
[Total Profit before tax],
KEEPFILTERS('Subsegment'[Sub_Segment] <> "Equity")
)
Using KEEPFILTERS here is important , it adds the exclusion on top of whatever filter context already exists from the visual, rather than replacing it. That way it only excludes Equity in that measure without touching what happens in the Insurance path.
Your SWITCH logic stays exactly as is, since the filtering lives inside the Other measure itself. The Insurance measure never sees this filte
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |