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.
Hello,
I am trying to calculate the YTD variance for my sample table shown below.
Table Name is "Project Costs"
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.
@Anonymous, you helped me last time, Please help me correct DAX calculation
PS: I have the date dimension included.
Thanks
Bhavesh
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |