Forum Discussion

CarlEThinggaard's avatar
CarlEThinggaard
Frequent Visitor
4 years ago

Calculation Group SELECTEDMEASURE interacting/overwriting other measures

I have tried to create a dynamic line chart based on 8 different measures as input, making the user able to switch between the measures, to get a dynamic view of the chart. At first, I created a small table with the headers of the measures, and I used a SWITCH(TRUE() function to select between various measures, as input to the chart: 

Selected Measure = SWITCH(TRUE(),

VALUES(Tabel[Selected Value 1] = "Value 1", [Measure 1],
VALUES(Tabel[Selected Value 2] = "Value 1", [Measure 2],
etc.
 

My initial issue was, that I would like to view some of these 8 measures as Whole Number, and some in Percentage in the chart. Unfortunately the "Selected Measure" measure can only be formatted to one type. I tried various solutions using FORMAT functions in the DAX expression for each individual measure, but this didn't work.

 

Therefore I created a Calculation Group in Tabular Editor instead, creating the 8 measures as Calculation Items, and using SELECTEDMEASURE as a substitute for the original SWITCH(TRUE()) function. In Tabular Editor I was able to format the measures with various formats, and use the calculation group as input in the chart in Power BI. At this point, the line chart itself worked as intended.

Unfortunately, I am now in a situation where the selected measure in the calculation group is overwriting the rest of the measures on my report page. Everything that is not hardcoded to a particular value/text string/etc. will take the value of the measure from the calculation group - fx. dynamic titles, cards and other visuals will all show the total value of the measure selected from the calculation group. I am looking for a solution to this issue, where the calculation group SELECTEDMEASURE() is not the dominant measure in all visuals, as the Selected Measure should only interact with part of the report page.

Thanks in advance!

3 Replies