Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
TheBishopEmpire
Frequent Visitor

Line/Area Chart plotting values restricted by YTD

I have a line/area chart that plots sales by day. I currently have it set as a "rolling 12 month" chart. Recently executives have asked for modification for it to only show YTD. This can't be solved by a slicer as this chart must reside on a dashboard that updates daily. 

 

This screen shot is of the rolling 12 month chart. My red line indicates where 2021 begins (roughly). The execs only want to see from the red line to current. 

Has anyone else been able to solve this similar delima? 

TheBishopEmpire_0-1614176692143.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @TheBishopEmpire ,

 

Try to filter the x-axis of your chart like so:

filter.gif

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @TheBishopEmpire ,

 

Try to filter the x-axis of your chart like so:

filter.gif

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@TheBishopEmpire , Try YTD like

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"), filter('Date', year('Date'[Date]) = year(Today())))

Thank you @amitchandak but how will that DAX filter the chart to YTD? The sales numbers I have by day are plotting as expected, I just need to have the chart dynamically shows only YTD. 

@TheBishopEmpire , if all values/measures on visual are YTD then only it will show YTD. 

 

Only YTD; measures like this will do

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

The last formula I have given to stop building YTD for a year other than this year 

 

you can also use a relative date filter if needed. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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