Forum Discussion
Filter does not apply properly
- 11 months ago
Hello knut12212
I would need to check your pbix to understand what you write because it sounds weird. MAX will anyway consider only what the filter context allows to see.
Can you please share the pbix? Also via private message if you prefer.
Best
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi knut12212
I’ve updated my answer below with your reply.
The reason your MAX doesn’t react to filters is because you used it directly:
VAR MaxFCGefiltert =
MAX ( 'PBI - Nettoaufwand FC'[FC Werte] )
This always scans the entire column. That’s why it doesn’t change.
Fix: wrap it with CALCULATE so it respects filter context:
Could you please try this:
MaxCoefficient =
VAR SelChannel = SELECTEDVALUE ( 'PB - Nettoaufwand FC'[Sales Channel] )
RETURN
CALCULATE (
MAX ( 'PB - Nettoaufwand FC'[C Werte] ),
'PB - Nettoaufwand FC'[Sales Channel] = SelChannel
)
Example:
- Without CALCULATE >> Max = 400 (global).
- With CALCULATE + Filter (Monat=2) >> Max = 300 (filtered).