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

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.

Reply
Pikachu-Power
Post Prodigy
Post Prodigy

legend when two values in the bar chart

hello,
i put two measures in the value field of a grouped bar chart in the following form:
 
Display_Value =
VAR _SelectedMeasure = SELECTEDVALUE ( 'Measure_Selection'[Measure] )
RETURN
    SWITCH(
        _SelectedMeasure,
        "IP",[Plan],
        "IFCI",[FCI],
        "IFCII",[FCII],
        "IFCIII",[FCIII]
    )
 
but i cant put a measure in the legend when i have two measure values. are there some workarounds?
 
3 REPLIES 3
v-jingzhang
Community Support
Community Support

@Pikachu-Power  See if these threads can help.

https://community.powerbi.com/t5/Desktop/Multiple-values-in-line-chart-with-legend/m-p/1357551

https://community.powerbi.com/t5/Desktop/Stagged-Bar-Chart-with-multiple-values/m-p/1392877

https://radacad.com/dax-measure-in-the-axis-of-the-power-bi-report

 

From your measure above, it seems you have used a dynamic measure, so do you want to show two measures listed in the switch function at the same time or show two measures that have a switch function at the same time? It seems to have a lot of info in a chart. I cannot show two measures at the same time with a legend in a bar chart. When using a dynamic measure, it shows only one measure every time switching a selection.

 

Additionally, I found a visual called Multiple Axes Chart from Power BI Visuals AppSource that can have multiple values with a legend. You may check if it can realize what you want. It will display like below.

v-jingzhang_0-1601449081447.jpeg

Click … in visualization panel to get more visuals.

v-jingzhang_1-1601449081449.png

amitchandak
Super User
Super User

@Pikachu-Power , The information you have provided is not making the problem clear to me. Can you please explain with an example.

In case you need a Measure slicer to refer.

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...


Appreciate your Kudos.


It is nothing special:

 

Unbenannt.PNG

When I have two measures in the values a legend is not accepted. Looking for a workaround for that. I have two measures because i want to see two bar charts. I think it is not possible to write only one measure to show two bar charts? For the measures I use see above.

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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