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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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