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
Kolumam
Post Prodigy
Post Prodigy

Selecting Multiple Measures using Selected Column

Hi All,

 

I have three measures and I have converted the measure to a slicer using selected column and selected value function. Now when I select one measure, it plots a graph. When I select multiple measures, it doesn't show anything.

Dynamic Selection = VAR selectedcolumn = SELECTEDVALUE(Parameter[Id])
RETURN
SWITCH(
    TRUE(),
    selectedcolumn = 1, CALCULATE([Cumulative Size Operating - planned]),
    selectedcolumn = 2, [Cumulative Size Operating],
    selectedcolumn = 3, [Cumulative Size Won])

See below images:

If I select one measure, it shows the graph.

Capture.PNG

 

 

 

 

If I select multiple measures, it doesn't show anything. How do I adjust the above DAX to show both the line graphs.

Capture3.PNG

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Kolumam 

You have to add your Parameter[Id] field to the legend in the chart.  That way SELECTEDVALUE() won't be getting multiple responses, when it does it returns BLANK().  Because the Parameter[Id] is now in the chart SELECTEDVALUE() can split up the lines.

You could also change your code so that rather than putting the ID in the legend, you can put the measure name in the legend which will help the users know what each line represents.

Dynamic Selection = VAR selectedcolumn = SELECTEDVALUE(Parameter[Measure])
RETURN
SWITCH(
    TRUE(),
    selectedcolumn = "Cumulative Size Operating - planned", CALCULATE([Cumulative Size Operating - planned]),
    selectedcolumn = "Cumulative Size Operating", [Cumulative Size Operating],
    selectedcolumn = "Cumulative Size Won", [Cumulative Size Won])

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @Kolumam 

You have to add your Parameter[Id] field to the legend in the chart.  That way SELECTEDVALUE() won't be getting multiple responses, when it does it returns BLANK().  Because the Parameter[Id] is now in the chart SELECTEDVALUE() can split up the lines.

You could also change your code so that rather than putting the ID in the legend, you can put the measure name in the legend which will help the users know what each line represents.

Dynamic Selection = VAR selectedcolumn = SELECTEDVALUE(Parameter[Measure])
RETURN
SWITCH(
    TRUE(),
    selectedcolumn = "Cumulative Size Operating - planned", CALCULATE([Cumulative Size Operating - planned]),
    selectedcolumn = "Cumulative Size Operating", [Cumulative Size Operating],
    selectedcolumn = "Cumulative Size Won", [Cumulative Size Won])

Awesome! It worked. Thank you!

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.

Top Solution Authors