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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LaurenceSD
Advocate II
Advocate II

Quick Measure Running Total - filter to stop line at today

Hi,

 

I've used a quick measure to calculate a running total for This year, last year, the year before and my Budget, by month, all is working fine except I can't seem to get a filter in there that'll stop the line for this year going past today

 

Here is the formula

 

Enqs FY21 Cuml =
CALCULATE(
    [Enqs FY21],
    FILTER(
        ALLSELECTED('Dates'[Correct Order FiscalM]),
        ISONORAFTER('Dates'[Correct Order FiscalM], MAX('Dates'[Correct Order FiscalM]), DESC)
    ))
 
& this is what it produces
 
LaurenceSD_0-1619782120710.png

 

I've tried to add in a filter on todays date, but when i do that i'm then seeing the cumulative stop

 

Enqs FY21 Cuml =
CALCULATE(
    [Enqs FY21],
    FILTER(
        ALLSELECTED('Dates'[Correct Order FiscalM]),
        ISONORAFTER('Dates'[Correct Order FiscalM], MAX('Dates'[Correct Order FiscalM]), DESC)
    ),FILTER(dates,Dates[Dates]<=today()))
 
LaurenceSD_1-1619782240020.png

 

 It doesn't seem to matter where I put the today filter I'm getting the same results

 

any suggestions are appreciated

 

Thanks

5 REPLIES 5
amitchandak
Super User
Super User

@LaurenceSD , Try like

 

Enqs FY21 Cuml =
CALCULATE(
[Enqs FY21],
FILTER(
ALLSELECTED('Dates'[Correct Order FiscalM]),
ISONORAFTER('Dates'[Correct Order FiscalM], MAX('Dates'[Correct Order FiscalM]), DESC) && 'Dates'[Correct Order FiscalM] <=today()
))

 

 

Filter should be on the date you have taken allselected , I think so

Thanks @amitchandak  but that still produces the same result as the first graph

@LaurenceSD ,is month or date in visual coming from date table if yes try like

 

Enqs FY21 Cuml =
CALCULATE(
[Enqs FY21],
FILTER(
ALLSELECTED('Dates'),
ISONORAFTER('Dates'[Dates], MAX('Dates'[Dates]), DESC) && 'Dates'[Dates] <=today()
))

 

or

 

 

Enqs FY21 Cuml =
if( max('Dates'[Dates]) <=today(),
CALCULATE(
[Enqs FY21],
FILTER(
ALLSELECTED('Dates'),
ISONORAFTER('Dates'[Dates], MAX('Dates'[Dates]), DESC)
)), blank())

Thanks, @amitchandak  I do have a date table in place, but I think there is something up with my model, potentially due to the size, that it keeps bugging out if I try to use the Date column instead of the month - any visual i use has the dots circling to say its refreshing, but it never actually does refresh (I'd originally done my cumulative values based on the date column), I think it's to do with the size of my model and some inefficient formulas (was done soon after learning some Dax). Your formulas look like they should work, I'll do some more digging my end. Thanks for your help

Hi @LaurenceSD ,

 

v-lionel-msft_0-1620114163115.png

It may also be related to the date field used by your X-axis.
If the problem persists, it is best to provide a sample .pbix file.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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