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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Maria9292
Helper II
Helper II

Filters are not applied to measures in table/matrix

Hi everyone!

 

I have table with columns that are these measures:

 

Calc_Green= CALCULATE(DISTINCTCOUNT('Table'[Qty)]),'Table'[Type]="Green"

Calc_Red= CALCULATE(DISTINCTCOUNT('Table'[Qty)]),'Table'[Type]="Red"

etc.

 

All columns and the slicer are from the same dataset. The problem is when the slicer applied (say I choose Red) values are shown in other columns as well although there should be null values in all columns except "Red"

 

What might be the problem here?

Thanks!

Maria

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Maria9292 , Try like

Calc_Red= CALCULATE(DISTINCTCOUNT('Table'[Qty]),filter(all('Table'),'Table'[Type]="Red"))

 

But better to Type table joined with  your table and then use the filter on type table

Calc_Red= CALCULATE(DISTINCTCOUNT('Table'[Qty]),filter(all('Type'),'Type'[Type]="Red"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @Maria9292,

Your formula will effect by slicers, when you apply one to the visual, these formulae with try calculated based on the condition. For the current row contents measure formula calculated, colors are being filtered by slicer so they will null value in the results. 

You can take a look at the following link about all functions to know more about this and add them to your formula to ignore the filter effect that applies to formulas:

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT 
Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Maria9292,

Your formula will effect by slicers, when you apply one to the visual, these formulae with try calculated based on the condition. For the current row contents measure formula calculated, colors are being filtered by slicer so they will null value in the results. 

You can take a look at the following link about all functions to know more about this and add them to your formula to ignore the filter effect that applies to formulas:

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT 
Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@Maria9292 , Try like

Calc_Red= CALCULATE(DISTINCTCOUNT('Table'[Qty]),filter(all('Table'),'Table'[Type]="Red"))

 

But better to Type table joined with  your table and then use the filter on type table

Calc_Red= CALCULATE(DISTINCTCOUNT('Table'[Qty]),filter(all('Type'),'Type'[Type]="Red"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.