Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I have around 15 measures in my model, which I need to show in a visual (line chart). The chart becomes unreadable if I add all of them directly. Hence, I thought of grouping the measures and providing a slicer to choose one or more of the groups to be displayed in the visual. I have created a table with the below structure-
Index | Measure Type | Measure Name
The table is not linked to any other table in my model. I have created a hierarchy out of this and added it as a slicer shown below-
I have created a measure as below to display the data in a line chart-
The issue that I'm facing is that the line chart fails to render when I select all (or more than 1) measure type or more than one measure under a specific type. My goal is to allow the user to select a group (such as Geographic Measures) and be shown a graph with multiple lines, each corresponding to the the separate measures like FIRM_CITY_FILL%, FIRM_STATE_FILL% etc.
Could someone please guide me on this?
Solved! Go to Solution.
Hi All,
The solutions suggested above did not suit my requirement. I was finally able to achieve it by using Field Parameters. This artcile contains the details and the usage of Field Parameters.
https://exceltown.com/en/tutorials/power-bi/powerbi-com-and-power-bi-desktop/power-bi-charts-and-vis...
Additionally, since I needed the measures to be grouped as per a specific hierarchy, I edited the DAX generated for the Field Parameter table and added an additional column that helped me set-up the hierarchy. The below video has a similar explanation-
https://youtu.be/qlhcN3A0HNU
I now have all my measures in a slicer, arranged in a specific hierarchy. I have one single visual, wherein I can show the value of any of the measures from the slicer, or a group from the slicer.
or you can try like this,
Hi All,
The solutions suggested above did not suit my requirement. I was finally able to achieve it by using Field Parameters. This artcile contains the details and the usage of Field Parameters.
https://exceltown.com/en/tutorials/power-bi/powerbi-com-and-power-bi-desktop/power-bi-charts-and-vis...
Additionally, since I needed the measures to be grouped as per a specific hierarchy, I edited the DAX generated for the Field Parameter table and added an additional column that helped me set-up the hierarchy. The below video has a similar explanation-
https://youtu.be/qlhcN3A0HNU
I now have all my measures in a slicer, arranged in a specific hierarchy. I have one single visual, wherein I can show the value of any of the measures from the slicer, or a group from the slicer.
Hi @SmithaKMurthy ,
this is because of at last you are using single measure (measureSelection) in the Bar chart so it gives single value and Switch also will return single value. For example you can check what value is returned from the below Switch.
SWITCH(TRUE(),
MeasureType="FruitRelated" && MeasureName="CostlierFruitPrice",1,
MeasureType="FruitRelated" && MeasureName="HighestSoldFruitQuantity",2,
MeasureType="VeggieRelated" && MeasureName="CostlierVeggiePrice",3)
Just Select the MeasureType as FruitRelated in the slicer and check what this measure returns eiter 1 or 2 or both.
One suggestion is, you can try with Calculation group in this case.
Please Accept it as a Solution if it solves your Problem. Thanks.
Create Table for measures and name the corresponding measures in the table e.g Measures_Nmae after that create measure with the combination of switch() and SelectedValue() using and return the measure with Measures_Name in the Query
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Hi,
Thanks for the reply. I don't quite follow what you are saying. I already have a table of measures and even a measure for the selection with the SWITCH(). But it doesn't seem to work. Since I can't share the actual data, I have tried to mock my problem with some silly data-
I have two tables as below-
I have a slicer as below-
The measure for the slicer selection is written as below-
When I try to see the value of this MeasureSelection, I always end up with the default value. I don't get the outputs of other cases. What am I missing?
Try with subcategory I mean avoid && condition it often create ambiguity
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Do you mean like this?
This won't work for multiple selections. That's the problem with my original question too.
User | Count |
---|---|
98 | |
90 | |
78 | |
71 | |
64 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |