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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Filtered Dax not showing correct result

Hey everyone!

I've got the following two DAX formula:

UPO Downloads = COUNTROWS('OD - UPO Downloads')

Running Total UPO Downloads = var maxDate = MAX('Dates'[Date]) return CALCULATE( 'OD - UPO Downloads'[UPO Downloads], REMOVEFILTERS( 'Dates'), 'Dates'[Date] <= maxDate)


And I've got the following filter and card:
LaZZaNoVa61_0-1654002373802.png

 

The Running Total Formula seems to ignore my filter.
So my question is: How can I make my Running Total Formula work in combination with the filter?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

please try

Running Total UPO Downloads =
VAR maxDate =
    MAX ( 'Dates'[Date] )
VAR minDate =
    MINX ( ALLSELECTED ( 'Dates' ), 'Dates'[Date] )
RETURN
    CALCULATE (
        'OD - UPO Downloads'[UPO Downloads],
        REMOVEFILTERS ( 'Dates' ),
        'Dates'[Date] <= maxDate,
        'Dates'[Date] >= minDate
    )

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Anonymous 

please try

Running Total UPO Downloads =
VAR maxDate =
    MAX ( 'Dates'[Date] )
VAR minDate =
    MINX ( ALLSELECTED ( 'Dates' ), 'Dates'[Date] )
RETURN
    CALCULATE (
        'OD - UPO Downloads'[UPO Downloads],
        REMOVEFILTERS ( 'Dates' ),
        'Dates'[Date] <= maxDate,
        'Dates'[Date] >= minDate
    )
Greg_Deckler
Super User
Super User

@Anonymous Well, yes, you used REMOVEFILTER so that is going to blow away all filters on that table. Try:

Running Total UPO Downloads = 
var maxDate = MAX('Dates'[Date]) 
var minDate = MIN('Dates'[Date]) 
return CALCULATE( 'OD - UPO Downloads'[UPO Downloads], REMOVEFILTERS( 'Dates'), 'Dates'[Date] <= maxDate, 'Dates'[Date] >= minDate)

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hey Greg,

I've tried your Dax formula, but that one returns only the amount of downloads of the last day. (31-3-2022) 
Instead of a running total of the entire period.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors