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
karyani
Frequent Visitor

Dax All not ignoring filter

the model has only 2 table FactTable and dimintions 

the measure bellow  works as expected, the calculation ignores the dimintion, (in a slicer)

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)))
  
if I add a filter on the FactTable it stops ignoring the Diminsion!
 
calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FILTER(FactTable,FactTable[CancelXID] <> BLANK())
                )
after adding the above filter on the FactTable the All(Dimintion) stops working. when selecting differnt values from the slicer the calculation changes.  what am I missing here, and how do I write the measure to ignore the Diminsion and still apply the ,FILTER(FactTable,FactTable[CancelXID] <> BLANK()?
 
thank you
1 ACCEPTED SOLUTION
sjoerdvn
Super User
Super User

try something like 

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FactTable[CancelXID] <> BLANK()
       )

or even

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FactTable[CancelXID] 
       )

View solution in original post

4 REPLIES 4
sjoerdvn
Super User
Super User

try something like 

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FactTable[CancelXID] <> BLANK()
       )

or even

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FactTable[CancelXID] 
       )

The fist option seems to work :), so why Filter does not work?

The FILTER expression is evaluated in the "default" context so it includes any filter on "Dimintion" (sic). If you really want to use FILTER (don't know why people are using filter all the time...) you could use something like:

 

calc = CALCULATE(DISTINCTCOUNT(FactTable[TransactionCode])
                ,All(Dimintion)
                ,FILTER(CALCULATETABLE(FactTable,All(Dimintion)),FactTable[CancelXID] <> BLANK())
       )

 

 

I don't "realy want to use Filter" I am trying to understand why it did not work, and what I am not understanding well when using it

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.