Forum Discussion
atul9063
7 years agoHelper III
Calculate Previous Month Without Using Measure
Hi Team, I have to calculate Prev month Value in column without using measure . Currently, i m using below formula in measure to calculate previous month.But i want same output using caluclat...
- 7 years ago
Try this one
Column = CALCULATE ( SUM ( Table1[MetricValue] ), DATEADD ( Table1[Date], -1, MONTH ), ALLEXCEPT ( Table1, Table1[Date] ) )or this one
Column = CALCULATE ( SUM ( Table1[MetricValue] ), FILTER ( Table1, Table1[Date].[MonthNo] = EARLIER ( Table1[Date].[MonthNo] ) - 1 ) ) - 7 years ago
Did you use first formula?
Could you show your formula?
Column = CALCULATE ( SUM ( Table1[MetricValue] ), DATEADD ( Table1[Date], -1, MONTH ), ALLEXCEPT ( Table1, Table1[Date] ) ) - 7 years ago
Hi atul9063,
By my tests, the last formula from Zubair_Muhammad should solve your problem.
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please feel free to ask.
Best Regards,
Cherry
PattemManohar
7 years agoCommunity Champion
atul9063 Please try this as a "New Column"
PrevMetric = LOOKUPVALUE(Test56PrevVal[Metric],Test56PrevVal[Date],DATEADD(Test56PrevVal[Date],-1,MONTH))
- atul90637 years agoHelper III
I m getting below error.Could you please help
- PattemManohar7 years agoCommunity Champion
atul9063 You are not referencing the correct field in the third parameter of LOOKUPVALUE. Please try this..
PreviousMonthMetricValue = LOOKUPVALUE(vw_Engmt_Metrices[MetricValue],vw_Engmt_Metrices[dt],DATEADD(vw_Engmt_Metrices[dt],-1,MONTH))
- atul90637 years agoHelper III
PattemManohar I m referencing third parameter as vw_Engmt_Metrices[dt],even then I m getting same error.