Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hi. I could not find the answer to this in other places, so I'll ask it here.
I would like to create a selector that will render different measures on the same chart.
For instance, I have a trend chart that shows users over time. I'd like to have a selector on the side so people can switch between users and transactions and revenue and have the same chart render that measure.
Thanks.
Solved! Go to Solution.
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
Hi,
An addtional issue I have is that the 2 measures I am toggling need to display in different formats. 1 to 1 decimal place and the other to 4 decimal places. This solution works for me apart from being able to dynamically be able to set the format of the measure returned.
Does anyone know if this is possible?,
Thanks in advance for your help,
Cheers,
Jack
Thanks for the reply but FORMAT returns a text value so my measures would be converted to text. So this won't work unfortunetly.
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?
Hi DataPerson,
Have you tried Phil_Seamark's solution?
https://1drv.ms/u/s!AtDlC2rep7a-jkiRG_LyHcv0RSXI
It works for me now. I've created a "Dynamic" query and then used the DAX "Switch" command to pre-select the set of measures.
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!
Hi @SHDJason,
Based on my testing, the solution provided above should work in your scenario. Have you tried them? If you still have any question feel free to post here.
In addition, if the solution works, could you accept the corresponding reply as solution to help others who may have similar issue easily find the answer and close this thread?
Regards
sorry, i haven't had a chance to test the solution yet. I'll close it as soon as i do. should be this week.
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
This is perfect!
This worked great. Thanks for sharing!
You need to do the following:
1. Create a table called "Measures" with 2 columns
You will fill up column 1 with the names of the measures you wish to show (i.e. transactions, revenue, etc.)
Column 2 is just an index (1,2,3,etc.)
MeasureName | MeasureID
Transactions | 1
Revenue | 2
etc.
2. Create a measure with the following syntax:
DisplayMeasure = SWITCH( TRUE(), MIN ( Measures[MeasureID] ) = 1, [Transactions Measure], MIN ( Measures[MeasureID ) = 2, [Revenue Measure] )
Expand this as neccessary.
Now create a slicer with Measure table column MeasureName .
In the chart or table , use the measure DisplayMeasure as your values field, and when you select the slicer, the chart will display the appropriate measure.
This is perfect. Worked just fine.
User | Count |
---|---|
93 | |
92 | |
85 | |
83 | |
49 |
User | Count |
---|---|
150 | |
142 | |
112 | |
73 | |
55 |