Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have two measures and slicer, but i need to change the legend to value in the slicer.
I have this.
I wanted, if i change slicer, the value of legend also changed.
Someone know if it is possible to changed the legend?
Thanks
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end, You may try the following two ways to see if they meet your requirements.
Method1:
Table:
Slicer:
You may create four meausres as below.
Measure 1 =
IF(
"Measure 1" in DISTINCT(Slicer[Measures]),
SUM('Table'[V1])
)
Measure 2 =
IF(
"Measure 2" in DISTINCT(Slicer[Measures]),
SUM('Table'[V2])
)
Measure 3 =
IF(
"Measure 3" in DISTINCT(Slicer[Measures]),
SUM('Table'[V3])
)
Measure 4 =
IF(
"Measure 4" in DISTINCT(Slicer[Measures]),
SUM('Table'[V4])
)
Result:
Method 2:
You may go to Power Query, unpivot 'V1', "V2", "V3", "V4".
Table 2:
Then you may use "Attribute" to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Sorry, did I misunderstand your question - I thought you wanted the legend (which you underlined in screenshot) to change with the slicer (in other words only show the value for measure that has been selected).
In any case, glad you found a solution!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end, You may try the following two ways to see if they meet your requirements.
Method1:
Table:
Slicer:
You may create four meausres as below.
Measure 1 =
IF(
"Measure 1" in DISTINCT(Slicer[Measures]),
SUM('Table'[V1])
)
Measure 2 =
IF(
"Measure 2" in DISTINCT(Slicer[Measures]),
SUM('Table'[V2])
)
Measure 3 =
IF(
"Measure 3" in DISTINCT(Slicer[Measures]),
SUM('Table'[V3])
)
Measure 4 =
IF(
"Measure 4" in DISTINCT(Slicer[Measures]),
SUM('Table'[V4])
)
Result:
Method 2:
You may go to Power Query, unpivot 'V1', "V2", "V3", "V4".
Table 2:
Then you may use "Attribute" to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I need a little bit more info about what you're using in the chart, but I don't know of a way to change the legend. You could change the title dynamically to show what's being displayed? Or turn off the legend and have another visual that acts as the legend?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |