Forum Discussion

NickDSL's avatar
NickDSL
Helper I
2 years ago
Solved

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...
  • NickDSL's avatar
    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)
    Return
    CALCULATE(
        CALCULATE([Avg Metric Act]), dGL_Dates[Period] = LastMonth)