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
SilvandeGraaf
New Member

DAX Measure not respecting filter context in powerBI visual

Context:

In Power BI, I want to create custom labels for my budget values. Currently, I'm using the following DAX measure:


label_Budget =
VAR BudgetAmount = [Budget_amount_total_no_Scope]
RETURN
CALCULATE(SWITCH(
TRUE(),
BudgetAmount > 0 && BudgetAmount < 1000, "€0",
BudgetAmount >= 1000 && BudgetAmount < 100000, "€0,.0K",
BudgetAmount >= 100000 && BudgetAmount < 1000000, "€0,.K",
BudgetAmount >= 1000000, "€0,,.#M") , ALLSELECTED())

My [Budget_amount_total_no_Scope] measure is defined as:


Budget_amount_total_no_Scope = SUM(daily_budget)

Issue:

The issue I'm facing is that the criteria in the label_Budget measure are applied to the total budget values, not per channel. As a result, a channel with a budget less than €1,000,000 gets the same label as a channel with a budget greater than €1,000,000 because the criteria are not applied individually to each channel.

Objective:

I want to modify my measure so that for every selected hierarchy level, the individual channel values are evaluated against the criteria in label_Budget.

 

Could someone help me adjust this measure so that it correctly applies the criteria at each individual channel level? Any guidance or suggestions would be greatly appreciated.

 

1 REPLY 1
some_bih
Super User
Super User

Hi @SilvandeGraaf without model and other details it is hard to provide possible solution.

Still, if you want to create and apply measure with all except logic, try using DAX function ALLEXCEPT on link





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

Proud to be a Super User!






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.