cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bhaveshp
Helper III
Helper III

How to calculate YTD Savings from my table given below

Hello,

 

I am trying to calculate the YTD variance for my sample table shown below. 

Table Name is "Project Costs" 

 

Capture.PNG

 

I want to calculate YTD variance for this table

The formula is YTD variance = (Current month Variance) - (December month's variance of last year)

 

I used the below DAX calculation 

 

YTD_Variance = SUM('Project Costs'[Variance]) - CALCULATE(SUM('Project Costs'[Variance]), PREVIOUSMONTH('Date'[Date]))

 

This calculation works for January 2018 month, but for February 2018 it is showing wrong calculation as shown below.

 

Ca2pture.PNG

 

 

@yash1105, you helped me last time, Please help me correct DAX calculation 

 

PS: I have the date dimension included. 

 

Thanks

Bhavesh

 

 

1 REPLY 1
yash1105
Advocate V
Advocate V

Try this 

Measure_Name =

VAR Last_Dec_Varience =
CALCULATE( [Variance],
FILTER(ALL('Dim - Date'),
'Dim - Date'[Calendar Year] = YEAR(TODAY())-1 && 'Dim - Date'[Month Of Year] = 12)
)

RETURN

[Variance] - Last_Dec_Varience

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors