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
sanimesa
Post Prodigy
Post Prodigy

DAX retrieve the Month/Quarter etc. from a Custom calendar table based on current date

I need to calculate MTD/QTD etc. sales based on a custom calendar. I already got the ranges for the custom calendar. 

My approach to calculate MTD - get the current month from the custom calendar by using a measure. Then sum the sales based on this month. Here is my measure:

 

(Curr Month Measure) =
VAR current_month_tab = FILTER('Calendar 445', [Date] = TODAY())
return CALCULATE(distinct('Calendar 445'[MonthNameShort]), current_month_tab)

 

This does seem to work but not sure the most efficient, Comments appreciated. 

2 REPLIES 2
WolfBiber
Employee
Employee

Hey,

check out TOTALMTD and TOTALQTD 

Greetings,

Wolf

@WolfBiber Does the TotalMTD etc function work for custom calendar? For instance, Nov 2017 actually ranges from Oct 28- Nov 25 in the current year. I need the sum of sales for the period, not sure how it will work out. 

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.