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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PowerRocky12
Helper I
Helper I

YTD Slicer

Hello,

 

I am trying to create a YTD and full year Slicer for my report. In most of my charts its a 5 year comparision so I would want this slicer to work not just for the current year but everything on my report. So if I chose YTD slicer, it would filter all5 fiscal years based on todays date in the fiscal year. My fiscal year starts April 1st so I would have to take this into account to.

 

I have looked at a few posts but I can't see anything that will help me. If anyone could share some ways I can do this or some links I would appricate it.

 

Thank you

3 REPLIES 3
nishantdatanomy
Frequent Visitor

I would suggest you do the following

 

- First create a the DAX calculation that gives your the desired result for YTD and FY

- Create Calculation groups using the DAX calculation

- Use the calculation groups as slicers

 

Nishant

amitchandak
Super User
Super User

@PowerRocky12 , Try like

YTD QTY forced=
var _max = today()
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))

 

last two Comments are alternatives that can be used

Hey, how will this help me create a slicer for my report though? I want a slicer that has "YTD" and "Full Year" Options.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.