Forum Discussion
NickDSL
2 years agoHelper I
Comparing MoM Data where Users can select current month
Hi we have the following date table called "dGLDates". GLPeriod Period YTD IsCurrentMonth Base Act Order Type Key Base Act - 11 7/1/2023 1 ACTUAL ACTUAL7/1/2023 Base Act...
- 2 years ago
Solution I came up with that works:
Avg Metric LM =Var SelectedDate= SELECTEDVALUE(dGL_Dates[Period])Var LastMonth = DATE(YEAR(SelectedDate), MONTH(SelectedDate) - 1, 1)ReturnCALCULATE(CALCULATE([Avg Metric Act]), dGL_Dates[Period] = LastMonth)
NickDSL
2 years agoHelper I
Solution I came up with that works:
Avg Metric LM =
Var SelectedDate= SELECTEDVALUE(dGL_Dates[Period])
Var LastMonth = DATE(YEAR(SelectedDate), MONTH(SelectedDate) - 1, 1)
Return
CALCULATE(
CALCULATE([Avg Metric Act]), dGL_Dates[Period] = LastMonth)