Forum Discussion
How to display different measures using a selector
- 9 years ago
I've managed to acheive this using a measure table.
Download the following PBIX file
https://1drv.ms/u/s!AtDlC2rep7a-jkiRG_LyHcv0RSXI
You'll notice on the 2nd page called 'All Sorts' you can choose different Measure names from the box in the top left and it works.
I create a static table called [Dynamic] that carries measures and then reference them in a calculated measure on the fly
Thanks for the reply but FORMAT returns a text value so my measures would be converted to text. So this won't work unfortunetly.
- dkay84_PowerBI8 years agoMicrosoft EmployeeAre your measures actual measures or calculated within the SWITCH measure? I wonder if they are separate measures each formatted themselves, and the SWITCH just calls them, if the formatting will be honored.
- jkenne018 years agoFrequent Visitor
Hi,
Thanks again for the reply. The measures are real measures. One to 1 decimal place, the other to 4 decimal place. My issues seems to bethat I need to format the field in the table that will display the measure based on the selection. And the overides the format of the individual measure.
The measure I am displaying is :
Impacts/TVR = IF(ISCROSSFILTERED('Measure Dimensions'[Measure]),SWITCH( TRUE(), VALUES('Measure Dimensions'[Measure]) = "Impacts",[Impacts],VALUES('Measure Dimensions'[Measure]) = "TVR",[TVR],BLANK()),BLANK())
Impacts is 1 decimal place. TVR is 4 decimal places. If I set the Impacts/TVR measure to General (Auto) it actual displays 4 decimals for Impacts and 2 for TVR. Which is odd!
- dkay84_PowerBI8 years agoMicrosoft EmployeeHave you set formatting in the table itself? Maybe set it to default/auto and see if it will detect the formatting of the measures
- Anonymous7 years agoNot applicable
I'm having the same problem where I have to choose one data type for my entire group of measures. For example, I can't use decimal for one measure, and integer for another. It's either all decimal or all integer.
Has anyone found a solution for having a metric selector slicer that allows different data types for different measures?
- Anonymous7 years agoNot applicable
Hi DataPerson,
Have you tried Phil_Seamark's solution?
https://1drv.ms/u/s!AtDlC2rep7a-jkiRG_LyHcv0RSXIIt works for me now. I've created a "Dynamic" query and then used the DAX "Switch" command to pre-select the set of measures.