Forum Discussion

jeanL's avatar
jeanL
Helper I
1 year ago
Solved

Condition Formating with Calculation group

I have a calculation group set up for selection of both percentile and metrics. Different metrics will have different band targets. Problem occurs when i try to set up for condtional formatting, the...
  • v-sgandrathi's avatar
    v-sgandrathi
    1 year ago

    Hi jeanL,

    You're absolutely right.

     

    Since you're using Field parameters or dynamic field selection, which your field [SelectedMetricValue] implies, Power BI internally uses implicit measures. This means that [SelectedMetricValue] is not a normal scalar value and cannot be referenced directly in a calculated measure like VAR Value = [SelectedMetricValue], as it results in a syntax error.

    To support dynamic metric evaluation using implicit measures, the correct approach is to use SELECTEDMEASURE().

    SELECTEDMEASURE() returns the current measure being evaluated in the visual, which is ideal for when you're using field parameter slicers for metric switching. It respects context, unlike trying to hardcode [SelectedMetricValue].

     

    I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
    If this post helped, please mark it as "Accept as Solution" so others can benefit as well.

     

    Best regards,
    Sahasra.