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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ranz_vincent
Helper I
Helper I

Adding YTD in a weekly Stack Graph

Hello, so I am having trouble on how to add a YTD columns to my visual and I was hoping find a way to add a YTD value that counts the distinct value of all the dates beside the weekly values. Also if I can use the suggested solution in making YTD values if I wanted to make another visual for Daily, Monthly or Yearly.

YTD sample data - Google Drive 

ranz_vincent_0-1738032423354.png

ranz_vincent_1-1738032579283.png

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @ranz_vincent 

 

You'll need to use a disconnected table that includes the week numbers, as well as an extra row for YTD. Then, create a measure to return the value based on either the week number or whether the row is for YTD.

danextian_0-1738050335108.png

danextian_0-1738050406317.png

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @ranz_vincent 

 

You'll need to use a disconnected table that includes the week numbers, as well as an extra row for YTD. Then, create a measure to return the value based on either the week number or whether the row is for YTD.

danextian_0-1738050335108.png

danextian_0-1738050406317.png

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I tried using this and used it on my report but the YTD column is not showing and I noticed that the sample data used in the file you sent was shown as January1, February1,March1...  the sample data should be from January1-10 could this be a factor on why the YTD column isn't showing?

ranz_vincent_2-1738225056253.png

ranz_vincent_3-1738225074371.png

 

I've figured out the the reason YTD column was not showing. I just needed to add a year filter and select the year. Thanks a lot 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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