cancel
Showing results 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.

## Running total - stop at today

Hi,

I've managed to create a running/cumulative total for my bookings, however, I'm trying but failing to find a way of stopping this year's line carrying on past today's date.

My Dax formula is

Bookings running total = CALCULATE(BOOKINGS[Bookings],DATESYTD('DATESBKGS&ENQS'[Dates-Bkg&Enq].[Date]))
& it produces this graph

What I'd like is for the orange line (2021) to stop at today's date (so currently it should only go as far as January)

Laurence

1 ACCEPTED SOLUTION

a slicer of dumb luck led me to the correct formula, when playing about with some other ideas I accidentally left out the .date from my date table and voila it worked - I'm guessing something to do with the way time intelligence works (i'd not marked my date table as a table, as I wanted to be able to use the predefined heirachy)

So this

CALCULATE(BOOKINGS[Bookings],DATESYTD('DATESBKGS&ENQS'[Dates-Bkg&Enq].[Date]))

becomes

CALCULATE(BOOKINGS[Bookings],DATESYTD('DATESBKGS&ENQS'[Dates-Bkg&Enq])

& it works strangely (or not so strangely I'm sure to some!)

5 REPLIES 5

a slicer of dumb luck led me to the correct formula, when playing about with some other ideas I accidentally left out the .date from my date table and voila it worked - I'm guessing something to do with the way time intelligence works (i'd not marked my date table as a table, as I wanted to be able to use the predefined heirachy)

So this

CALCULATE(BOOKINGS[Bookings],DATESYTD('DATESBKGS&ENQS'[Dates-Bkg&Enq].[Date]))

becomes

CALCULATE(BOOKINGS[Bookings],DATESYTD('DATESBKGS&ENQS'[Dates-Bkg&Enq])

& it works strangely (or not so strangely I'm sure to some!)

Community Support

Hi @LaurenceSD ,

Try to do like this.

``````Measure =
VAR x =
CALCULATE(
SUM(Sheet9[Value]),
DATESYTD(Sheet9[Date])
)
RETURN
IF(
MAX(Sheet9[Date]) > TODAY(),
BLANK(), x
)``````

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.

@v-lionel-msft thanks for the suggestions, neither option seems to be working for me right now, not sure if it's because I'm using a Distinctcount formula to calculate my number of bookings?

Super User

@LaurenceSD You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

thanks @Greg_Deckler I've not yet quite found the formula from your list that does what I'm looking for, but I'm sure it must be in there, I'll keep on persevering, thanks for your help

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors