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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
merep
Frequent Visitor

TOTALYTD with dynamic fiscal year

I am working in a model that needs do do a TOTALYTD calculation, with a different start/end of year, and I need to pass the end date of the year as a parameter of some sort.

When I use this, it works:

TOTALYTD([CTB PL mov], CALENDAR[Date], "30/6")
 
But when I pass the same string as a parameter:
TOTALYTD([CTB PL mov], CALENDAR[Date]'FECHA CIERRE EJERCICIO'[FECHA CIERRE EJERCICIO])
merep_0-1675871512956.png

It simply returns the calculation based on the standard calendar, ignoring the new end date passed.

The parameter is set when the dataset is loaded the first time from a list with all the end dates of every month.

 

Is what I am doing possible?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@merep , I doubt as of now, it does not support dynamic string.

 

if you have only few values to support you can write like

 

Switch(selectedvalue([Year end]) ,

"30/6", TOTALYTD([CTB PL mov], CALENDAR[Date], "30/6"),

"31/7", TOTALYTD([CTB PL mov], CALENDAR[Date], "31/7"),

// add others

TOTALYTD([CTB PL mov], CALENDAR[Date], "31/12") //default

 

)

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@merep , I doubt as of now, it does not support dynamic string.

 

if you have only few values to support you can write like

 

Switch(selectedvalue([Year end]) ,

"30/6", TOTALYTD([CTB PL mov], CALENDAR[Date], "30/6"),

"31/7", TOTALYTD([CTB PL mov], CALENDAR[Date], "31/7"),

// add others

TOTALYTD([CTB PL mov], CALENDAR[Date], "31/12") //default

 

)

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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