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
Anonymous
Not applicable

YTD not working with date slicer

Hello all,

 

I am having an issue with a YTD calculation not working when selecting an earlier date on the date slicer. It works fine when the max date is selected, but if I choose another date it only shows the values for that date period only, not a YTD total up until that date (like I would want). Here is my measure: 

 

YTD% = CALCULATE([CountDistinctIOPs],DATESYTD('Date Table'[Date])

 

Source	2020 YTD
A	49
B	32
C	25
D	10
E	9
F	4
G	4
H	4
I	1
Total	138

Above is what I get with max date selected. Let's say the previous month YTD was less by 30, I would want to see this when that date is selected.

Source	2020 YTD
A	39
B	22
C	20
D	10
E	4
F	4
G	4
H	4
I	1
Total	108

 However, I am getting this which is the total for that month only.

Source	2020 YTD
A	10
B	6
C	5
D	4
E	3
F	2
G	1
H	0
I	0
Total	31

 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

Well, would probably need to see the formula for the measure.

 

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

That is strange you cannot see it in the post - it's there with some sample data you probably can't see. The calculation is just a simple: calculate([MyCountMeasure]),DATESYTD(DateFieldFromDateTable)

My date table is marked as a date table. Hope that helps...

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.

Top Solution Authors