Forum Discussion

Picco's avatar
Picco
Frequent Visitor
1 year ago
Solved

Calculation Group and SelectedValue

Good day   I have 4 Calculation Items in my Calculation Group   MTD = CALCULATE(SELECTEDMEASURE(), DATESMTD('Date'[ADate]) ) MTD PY =  CALCULATE( SELECTEDMEASURE(), DATEADD(DATESMTD('Date'[ADate...
  • johnt75's avatar
    1 year ago

    Calculation group logic is only applied once per measure, so statements like

    VAR _Value = CALCULATE( SELECTEDMEASURE(), CG_TimeIntelligence[Name] = "MTD PY" )

    won't work.

    What you could do is to create a separate calculation group for labels, which would then be able to call the time intelligence calculation items. You could have the calculation item return a numeric value for the variance, which you would then be able to detect in conditional formatting, and use the format string property of the label calculation item to return the formatted string using the exact code you already have in the Label calculation item you posted.