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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
FilipVDR
Helper II
Helper II

Dax Measure which ignores one filter is not working

To calculate the cars that went out of service (VoertuigDatumUitDienst) in the last year i'm creating this measure.
I want to ignore the CarStatus slicer (VoertuigStatusCode). Though it keeps changing my measure when I filter on VoertuigStatusCode. Any idea's?
 
AantalAutoUitDienstAfgelopenJaar =
CALCULATE(
    DISTINCTCOUNT('d_voertuig'[D_Voertuig_BID]),
    ALLEXCEPT('d_voertuig', 'd_voertuig'[VoertuigStatusCode]),
    FILTER(
        'd_voertuig',
        'd_voertuig'[VoertuigDatumUitDienst] >= DATE(YEAR(TODAY())-1,1,1) &&
        'd_voertuig'[VoertuigDatumUitDienst] <= DATE(YEAR(TODAY())-1,12,31)
    )
)
1 ACCEPTED SOLUTION
FilipVDR
Helper II
Helper II

I found the solution was easier than I thought:

AantalAutoUitDienstAfgelopenJaar =
CALCULATE(
    DISTINCTCOUNT('d_voertuig'[D_Voertuig_BID]),
    REMOVEFILTERS(d_voertuig[VoertuigStatusCode]),
    year(d_voertuig[VoertuigDatumUitDienst]) = year(today())-1
)

View solution in original post

5 REPLIES 5
FilipVDR
Helper II
Helper II

I found the solution was easier than I thought:

AantalAutoUitDienstAfgelopenJaar =
CALCULATE(
    DISTINCTCOUNT('d_voertuig'[D_Voertuig_BID]),
    REMOVEFILTERS(d_voertuig[VoertuigStatusCode]),
    year(d_voertuig[VoertuigDatumUitDienst]) = year(today())-1
)
talespin
Solution Sage
Solution Sage

hi @FilipVDR 

 

If possible please share pbix file with mock data.

talespin
Solution Sage
Solution Sage

hi @FilipVDR 

 

Instead of ALLEXCEPT('d_voertuig''d_voertuig'[VoertuigStatusCode])

use

REMOVEFILTERS('d_voertuig'[VoertuigStatusCode])

When I change to removefilters, same behavior. When i click on the slicer of "voertuigstatuscode" the measure keeps changing.
 
AantalAutoUitDienstAfgelopenJaar =
CALCULATE(
    DISTINCTCOUNT('d_voertuig'[D_Voertuig_BID]),
    REMOVEFILTERS('d_voertuig'[VoertuigStatusCode]),
    FILTER(
        'd_voertuig',
        'd_voertuig'[VoertuigDatumUitDienst] >= DATE(YEAR(TODAY())-1,1,1) &&
        'd_voertuig'[VoertuigDatumUitDienst] <= DATE(YEAR(TODAY())-1,12,31)
    )
)

Hi @FilipVDR 
 
You also need to remove filter on table.
 
I have used ALL(Tablename), please do not use only table name, instead use
ALL(Column or column names)
Example ALL('d_voertuig'[D_Voertuig_BID], 'd_voertuig'[VoertuigDatumUitDienst])
ALLSELECTED if you want another slicer to impact this measure.
 
CALCULATE(
    DISTINCTCOUNT('d_voertuig'[D_Voertuig_BID]),
    REMOVEFILTERS('d_voertuig'[VoertuigStatusCode]),
    FILTER(
        ALL('d_voertuig'),
        'd_voertuig'[VoertuigDatumUitDienst] >= DATE(YEAR(TODAY())-1,1,1) &&
        'd_voertuig'[VoertuigDatumUitDienst] <= DATE(YEAR(TODAY())-1,12,31)
    )
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.