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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
AJTK
Frequent Visitor

TotalMTD Function Not Working As Intended

Hi, I'm stumped here. 

 

I have a table with Production info. It's linked to my DimCalendar. My issue is the Yesterday's Production and YTD Production both show correct values, but the MTD Production doesn't show anything (totally blank). Here are the 3 measures I'm using: 

 

1. Yesterday's Production - My measure: 

= CALCULATE([Measure_Total Production],FILTER('DimCalendar','DimCalendar'[Date] = TODAY() - 1 && 'DimCalendar'[Working Day] = "Workday"),ALL('Production Table'[Production Date]))
 

2. Month to Date Production - My measure: 

= TOTALMTD([Measure_Total Poduction],'DimCalendar'[Date],ALL('Production Table'[Production Date]))
 

3. Year to Date Production

= TOTALYTD([Measure_Total Production],'DimCalendar'[Date],ALL('Production Table'[Production Date]))

 

I can get the month to date to populate if I add a date filter (date is in the last 1 year) to the VISUAL. However, adding that filter to the visual messes up another measure I have (not shown above), which doesn't link to the DimCalendar in the same way. 

 

What am I missing here? The measure is working correctly when I have the date filter on, but why do I have to have the filter on the visual? Is there some way to rewrite my MTD measure to add the filter on the measure, so I don't have to add it to the visual? 


Thanks!

 

 

1 ACCEPTED SOLUTION
Joe_Barry
Solution Supplier
Solution Supplier

Hi @AJTK 


Have you set your calenadar table as a Date table?

What are you trying achieve by having the ALL('Production Table'[Production Date]) at the end of the measure? 

TOTALYTD MTD need a date context to work. 

 

Example. TOTALMTD([Measure_Total Poduction],'DimCalendar'[Date]) will show balnk if there is no date filter on the page or no date context in the visual. Lets say if you choose a date range between Nov 23 and March 24 in a date filter/slicer, you will get MTD for March 24, but if you have a visual with dates in it, you will get the MTD to end of each month visible in the visual.

 

I hope this clears up what you need.

 

Thanks

Joe

 

If you found my answer helpful and it solved your issue, please accept as solution

 

 

View solution in original post

1 REPLY 1
Joe_Barry
Solution Supplier
Solution Supplier

Hi @AJTK 


Have you set your calenadar table as a Date table?

What are you trying achieve by having the ALL('Production Table'[Production Date]) at the end of the measure? 

TOTALYTD MTD need a date context to work. 

 

Example. TOTALMTD([Measure_Total Poduction],'DimCalendar'[Date]) will show balnk if there is no date filter on the page or no date context in the visual. Lets say if you choose a date range between Nov 23 and March 24 in a date filter/slicer, you will get MTD for March 24, but if you have a visual with dates in it, you will get the MTD to end of each month visible in the visual.

 

I hope this clears up what you need.

 

Thanks

Joe

 

If you found my answer helpful and it solved your issue, please accept as solution

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors