cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
LaurenceSD
Helper III
Helper III

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors