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
carnage66
Frequent Visitor

SUM values for current month but with projection for incomplete month

Hi all,

I have the following measures with the idea to calculate deviation between months:

 

CurrentMonth = CALCULATE(SUM('Transactions'[Volume]),
FILTER('Days', 'Days'[Month] = MAX('Days'[Month])))
 
PreviousMonth = CALCULATE(SUM('Transactions'[Volume]),
FILTER(ALL('Days'),'Days'[Month] = MAX('Days'[Month])-1))
 
Deviation = [ThisMonth]/[PreviousMonth]-1
 
However, the problem is that my current month is always incomplete. For example today is 18 April, so my deviation for April is always on negative % because it calculates incomplete month vs full previous month:
carnage66_1-1650294043852.png
Is there a way to update the measure for current month to include a projection for the full month. For example to divide the volume by 18 days and multiple by 30 (depending how long current month is) to create projection for the current month which will then be used for the projected deviation. 
 
Hope I explained it well enough. If you have some other idea, I'd appreciate it. 
 
Edit: I just noticed that Volume in March is not the same as PreviousMonth in April (very slight difference). Any idea why that might be?
2 REPLIES 2
amitchandak
Super User
Super User

@carnage66 , Try Datesmtd with date table

 

example

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

 

or

 

MTD QTY forced=
var _max = today()
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALMTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))


LMTD QTY forced=
var _max = date(year(today()),month(today())-1,day(today()))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)

 

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

Thanks, I will use these for previous month but unfortunately none of them help with the idea of a projection for the current month. The main idea is to create a measure where if the month is not complete, divides the sum by current date and multiplies it by the max days in the month, while for complete months shows just the sum. 

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.