Forum Discussion
Condition Formating with Calculation group
- 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.
Hello
Thanks for responding to this.
I believe due to the implicit measures required, this doesnt apply in the field value.
- v-sgandrathi1 year agoCommunity Support
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.- v-sgandrathi1 year agoCommunity Support
Hi jeanL,
I wanted to check in your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply as Accepted solution and give Kudos that helped you. It would be greatly appreciated by others in the community who may have the same question.
Thank you.