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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
admin11
Memorable Member
Memorable Member

How to make YTD_DATE expression display dynamic ?

Hi All

@v-yalanwu-msft @amitchandak  have help me on below post :-

https://community.powerbi.com/t5/Desktop/How-to-add-period-YTD-table/m-p/1828677#M709125

Now when user click on 2016 , it still display May 2021

admin11_0-1620353656369.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@admin11 

You are filtering the Year in the date. try change it to [Date].[Year]

 

Measure = IF(ISFILTERED('Table'[Date].[Year]),FORMAT(MAX('Table'[Date]),"MMMM-YYYY"),FORMAT(TODAY(),"MMMM-YYYY"))
V-pazhen-msft_0-1620716336033.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@admin11 

 

Check attached pbix.

 

Paul

Anonymous
Not applicable

@admin11 

You are filtering the Year in the date. try change it to [Date].[Year]

 

Measure = IF(ISFILTERED('Table'[Date].[Year]),FORMAT(MAX('Table'[Date]),"MMMM-YYYY"),FORMAT(TODAY(),"MMMM-YYYY"))
V-pazhen-msft_0-1620716336033.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

@Anonymous 

Kindly share the PBI file , so that i can understand , how to change the Year field for select to Date.Year

Paul

amitchandak
Super User
Super User

@admin11 , Try like

 

YTD DATE =
var _max = MAX('Date'[Date])
var _min = MIN('Date'[Date])
var _a=format(_min, "MMM-YYYY") & " to " & format(_max, "MMM-YYYY") & " SALES BY BRAND_C"
return IF(ISFILTERED('Date'[Date]) || ISFILTERED('Date'[Year]) ,_a,format(TODAY(), "MMM-YYYY"))

 

You need more ISFILTERED based on the slicer you want to skip today

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

still  the same when i click on 2020 it still display May 2021.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors