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

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
 
 
 

Screenshot 2021-01-22 180446.png

 

 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)
 
Thanks in advance of any suggestions and answers
 
Laurence
 
1 ACCEPTED SOLUTION
LaurenceSD
Helper III
Helper III

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!)

View solution in original post

5 REPLIES 5
LaurenceSD
Helper III
Helper III

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!)

v-lionel-msft
Community Support
Community Support

Hi @LaurenceSD ,

 

Try to do like this.

v-lionel-msft_0-1611566705875.png

Or please use this formula.

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

v-lionel-msft_1-1611567010532.png

 

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?

Greg_Deckler
Super User
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...


@ 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...

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

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