The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I have created a claculation group in which each calculation item is a different existing measure.
This allows the user to change the measure a visual shows, and it works great.
The ca
However, now I want to add a second measure- a target.
I was hoping to to use SELECTEDVALUE('Metric Selection'[Metric]) to pick a target,
but any measure referencing 'Metric Selection'[Metric] just returns the underlying measure in the selected calculation item, for example- Reviews.
Is there any DAX expression that will return the name of the selected calculation item?
Thank you.The user picks a measure (calculation item) to choose what the visual shows.
My calculation group.
Solved! Go to Solution.
I think this can be avoided by using if within the calculation group.
So if you include this logic in the calculation items it should work:
IF(selectedmeasurename()="Name of calc grp",selectedmeasure(), Your original calculation item logic)
Alternative option would be to make another calculation group which would have the logic I described above and assign its precedence to be before the original calculation group.
Proud to be a Super User!
I think this can be avoided by using if within the calculation group.
So if you include this logic in the calculation items it should work:
IF(selectedmeasurename()="Name of calc grp",selectedmeasure(), Your original calculation item logic)
Alternative option would be to make another calculation group which would have the logic I described above and assign its precedence to be before the original calculation group.
Proud to be a Super User!
It worked! You're awesome!
I have created another Calculation Group with 2 measures: Value and Target. I gave it precedence over the original group.
I have changed the calculated items this way- for example, Reviews:
IF(SELECTEDMEASURENAME()="Target",
[An expression that uses SELECTEDVALUE('MI Metric Selection'[Metric]) to get the Revies Target},
[Reviews])
Finally, in the visual I shared, I now plot the Value from this new calculation group (here it would return [Reviews]) and the Target. Perfect!
Hi (by the way I love your report theme),
I am pretty sure calculation groups don't have anything like SELECTEDMEASURENAME, but as a workaround you could just use MAX('MI Metric Selection'[Name]) In you example it should return "Reviews".
I hope this helps to solce your issue and if it does consider accepting this as a solution!
Proud to be a Super User!
Thank you- it's rather close, but not there yet.
MAX('MI Metric Selection'[Metric]) return a metric name when nothing is selected from the calculation group (e.g. disabling the filtering from "edit interactions"), but when a calculation item is chosen, this measure return the chosen metric's resault (a number) rather than the name.
I can't overcome this sticky, tenacious behavior that any measure that's affected by a calculation group returns it's value, but not name.
Solutions that work on DAX Studio don't work in the roeport itsels.
Even the Measure
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |