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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Year to Date Graph

Energy_Engineer_0-1654101743973.png

I am trying to build a chart that shows the data of each week as well as the YTD total as it goes through the weeks. Currently my DAX function is: 

Actuals YTD = TOTALYTD(SUM(Table1[Quantity]),'Date Table'[Date],all(Table1[Delivery Date]),"12/31")
This is my DAX formula for a calculated column within my data table.
The 'Date Table' is a table that I created using a DAX formula to link my all of my dates across the report.
Why isn't my YTD function showing YTD? Even though the quantity is decreasing week over week, the YTD line should still be increasing. If possible, please provide some insight into what I am doing wrong with my YTD function and how I can edit it to get the graph I want. Thank you.
1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hi:

I'll attach a file for you. Please see page 2 "YTD". I hope you can mark as solution if this works for you. Thankshttps://drive.google.com/file/d/1lzi428Xm1DqMPlMOkMjXoYKALkvJxvlv/view?usp=sharing 

 

Whitewater100_0-1654106006117.png

Sometimes it's tough to compare weekly sales to YTD , especially when the YTD figures dwarf the weekly figures.

View solution in original post

6 REPLIES 6
Whitewater100
Solution Sage
Solution Sage

Hi:

Were you able to check on the solution? Thanks..

Whitewater100
Solution Sage
Solution Sage

Hi:

I'll attach a file for you. Please see page 2 "YTD". I hope you can mark as solution if this works for you. Thankshttps://drive.google.com/file/d/1lzi428Xm1DqMPlMOkMjXoYKALkvJxvlv/view?usp=sharing 

 

Whitewater100_0-1654106006117.png

Sometimes it's tough to compare weekly sales to YTD , especially when the YTD figures dwarf the weekly figures.

Anonymous
Not applicable

This solution worked for me:

YTD = CALCULATE(sum(Table1[Quantity]),DATESYTD('Date Table'[Date]))
Also, adding YTD on a secondary axis helps solve the problem of YTD dwarfing the actuals.
Whitewater100
Solution Sage
Solution Sage

Hi:

Your Date Table should ocnnect to your Fact Table [Delivery Date] and then you don't need that column in your measure.

YTD = CALCULATE(SUM(Table1[Quantity]), DATESYTD('Date Table'[Date]) or

YTD = TOTALYTD(SUM(Table1[Quantity]), 'Date Table'[Date])

 

I hope this helps!

Anonymous
Not applicable

@Whitewater100 Thank you for your suggestion, but neither of these expressions provided a different visual than shown above. Are there any other ways to calculate year to date?

Yes but those should work if you have date table marked as Date Table with only consequtive date. 

If this next sugestion doesn't work, please send an example pbix file as something seems off.

Total Sales = SUM(Table1[Quantity])

Cumulative Sales = CALCULATE([Total Sales], 
                               FILTER(ALLSELECTED('Date Table'[Date]), 
                               'Date Table'[Date] <= MAX('Date Table'[Date]))

If you have multiple years you can add IF statement preceding:

 = IF('Date Table'[Year] = "2022", FORMULA ABOVE 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors
Users online (60)