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
Anonymous
Not applicable

dax measure with ALL( DatesTable) does not ignore date filter

Hi Folks,

 

I want to calculate:
AccountsReceivable = CALCULATE( SUMX( FACT_Actuals_Master, (FACT_Actuals_Master[Credits] - FACT_Actuals_Master[Debits]) )
 
I also need to add the filter FILTER( FACT_Actuals_Master, [Account Master Name] = "Accounts Receivable")
 
I also want to ignore any filtering coming from the relationship Datestable[DATE] = FACT_Actuals_Master[Date]

I have: AccountsReceivable =  CALCULATE( SUMX( FACT_Actuals_Master, (FACT_Actuals_Master[Credits] - FACT_Actuals_Master[Debits]) ),
FILTER( FACT_Actuals_Master, [Account Master Name] = "Accounts Receivable"),
ALL(DatesTable) )

There is a DatesTable[MonthYear] in the filters pane acting on all pages, when it is used, the AccountsReceivable total changes, but is should remain constant.

Any thoughts/pointers?
 
Thanks
1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Please try this version.

Converted_AR2 =
VAR SelectedRate =
    SWITCH (
        TRUE (),
        [SelectedCurrency] = "CAD", 1,
        [SelectedCurrency] = "EUR", P_EUR_to_CAD_Rate[EUR_to_CAD_Rate_Value],
        [SelectedCurrency] = "INR", DIVIDE ( 1, P_INR_to_CAD_Rate[INR_to_CAD_Rate_Value] ),
        [SelectedCurrency] = "USD", P_USD_to_CAD_Rate[USD_to_CAD_Rate_Value],
        BLANK ()
    )
VAR ExchangeRate =
    IF (
        MAX ( DatesTable[Date] ) > Labels[Ledger_LatestDate],
        SelectedRate,
        [Exchange_Rate_Normalised]
    )
VAR AccountsReceivable =
    CALCULATE (
        SUMX (
            FACT_Actuals_Master,
            ( FACT_Actuals_Master[Credits] - FACT_Actuals_Master[Debits] )
        ),
        FACT_Actuals_Master[Account Master Name] = "Accounts Receivable",
        ALL ( DatesTable )
    )
RETURN
    AccountsReceivable * ExchangeRate * -1

 

Pat

Microsoft Employee

View solution in original post

5 REPLIES 5
ppm1
Solution Sage
Solution Sage

Please try this version.

Converted_AR2 =
VAR SelectedRate =
    SWITCH (
        TRUE (),
        [SelectedCurrency] = "CAD", 1,
        [SelectedCurrency] = "EUR", P_EUR_to_CAD_Rate[EUR_to_CAD_Rate_Value],
        [SelectedCurrency] = "INR", DIVIDE ( 1, P_INR_to_CAD_Rate[INR_to_CAD_Rate_Value] ),
        [SelectedCurrency] = "USD", P_USD_to_CAD_Rate[USD_to_CAD_Rate_Value],
        BLANK ()
    )
VAR ExchangeRate =
    IF (
        MAX ( DatesTable[Date] ) > Labels[Ledger_LatestDate],
        SelectedRate,
        [Exchange_Rate_Normalised]
    )
VAR AccountsReceivable =
    CALCULATE (
        SUMX (
            FACT_Actuals_Master,
            ( FACT_Actuals_Master[Credits] - FACT_Actuals_Master[Debits] )
        ),
        FACT_Actuals_Master[Account Master Name] = "Accounts Receivable",
        ALL ( DatesTable )
    )
RETURN
    AccountsReceivable * ExchangeRate * -1

 

Pat

Microsoft Employee
Anonymous
Not applicable

@ppm1  Thanks ppm1, that works perfectly for me.

Anonymous
Not applicable

@Greg_Deckler I think I've shared a sample database with you here: https://www.dropbox.com/s/lhmjui5bmkgsri2/AR%20Database.pbix?dl=0

New to this, may not have done this properly.

Anonymous
Not applicable

@Greg_Deckler, thanks, I'll take a look at that and if I can't see anything obvious I'll set up a pbix replicating the problem.

Greg_Deckler
Community Champion
Community Champion

@Anonymous It's hard to be certain what is going on here. Sometimes these kinds of issues are caused by the Auto-exist "feature".



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

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.