Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rbriga
Impactful Individual
Impactful Individual

Calculation Groups- More Than One Measure For Each Calculation Item

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.The user picks a measure (calculation item) to choose what the visual shows.My calculation group.My calculation group.

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!
1 ACCEPTED SOLUTION
ValtteriN
Super User
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.

ValtteriN_0-1638963580645.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ValtteriN
Super User
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.

ValtteriN_0-1638963580645.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




rbriga
Impactful Individual
Impactful Individual

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!

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!
ValtteriN
Super User
Super User

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!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




rbriga
Impactful Individual
Impactful Individual

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 

Twelve = 12
Returns the chosen calculated item when plotted together.Calculation Group Oddity.png
-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.