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
DanielCarvalho
Helper III
Helper III

YTD values from inicial of fiscal year up to the month selected

I  have been trying to create a measure to get me a card with the total value of the fiscal year up to the month selected in the slicer but it is always getting me the value to the current day and not the selected month... Here is my current measure:

 

 = CALCULATE(COUNT(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED]),DATESYTD(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED], "30/9" ))
 
My fiscal year starts in october. How can I change this dax measure to give me up to the selected period instead of today? 
1 ACCEPTED SOLUTION
DanielCarvalho
Helper III
Helper III

I have fixed it as it had to do with the relationships my calendar data had with my main table as a new column had to be created. 

 

In terms of the measure I ended up using, it was the following:

 

Closed_Tickets(YTD) = CALCULATE(SUM(TICKET_DASHBOARD_GAVATAR_HISTORY[Closed or Not]),DATESYTD('CALENDAR'[DATE], "30/9" ))
 
Kind Regards, Daniel

View solution in original post

3 REPLIES 3
DanielCarvalho
Helper III
Helper III

I have fixed it as it had to do with the relationships my calendar data had with my main table as a new column had to be created. 

 

In terms of the measure I ended up using, it was the following:

 

Closed_Tickets(YTD) = CALCULATE(SUM(TICKET_DASHBOARD_GAVATAR_HISTORY[Closed or Not]),DATESYTD('CALENDAR'[DATE], "30/9" ))
 
Kind Regards, Daniel
Manokamna
Advocate IV
Advocate IV

To modify your DAX measure to calculate the total value of the fiscal year up to the month selected in the slicer, you can replace the second argument of the DATESYTD function with a custom end date. Try this:

Total Value = CALCULATE(
COUNT(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED]),
DATESYTD(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED], "10/1"),
FILTER(
ALLSELECTED(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED]),
TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED] <= MAX(TICKET_DASHBOARD_GAVATAR[ACTIONDATE_FORMATTED])
)
)

The suggested measure is giving me the month to date value instead of year to date 

DanielCarvalho_0-1678795089792.png

As you see i have both represented and the ytd and mtd and they both always the same regardless of whatever month I choose in my slicer

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.