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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Plot multiple measures against a 'single' value of slicer selection

Hi all,

 

I have a requirement to plot 2 measures (actual and forecast) on Y axis in a line chart against each month. I have total of 6 measures that belong to three categeries. Something like below.

 

X (actual XX, forecast XX)

Y actual YY, forecast YY)

Z (actual ZZ, forecast ZZ)

 

I need to use a slicer with 3 options to select from however, when I select any one from above, the graph should dynamically plot the 2 measures in the selected category. For instance, I select option 'X', the line graph should plot actuals and forecast (2 measures) against the date (month) on the x axis. I went through many posts and found solution to have ONE measure plotted against ONE selection but could not find where I could plot MULTILPE measures (in my case 2) for a single selection in the slicer. Any help will be greatly appreciated.

 

Thanks.

1 ACCEPTED SOLUTION
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

Essentially what you need to do is created a disconnected dimension that provides the users with a measure type to select, in your case {X,Y,Z}, then create a actual and forecast measure that returns the appropriate value based on the user selection, looking something like:

Actual = 
    IF(HASONEVALUE('metric selection'[Metric]),
    SWITCH(
            VALUES('metric selection'[Metric]), 
            "X", SUM(metrics[actual x]),
            "Y", SUM(metrics[actual y]),
            "Z", SUM(metrics[actual z])
), BLANK())

Forecast = 
    IF(HASONEVALUE('metric selection'[Metric]),
    SWITCH(
            VALUES('metric selection'[Metric]), 
            "X", SUM(metrics[Forecast x]),
            "Y", SUM(metrics[Forecast y]),
            "Z", SUM(metrics[Forecast z])
), BLANK())

You will find a sample pbix file here sample.pbix 

 

richbenmintz_0-1597934125887.png

richbenmintz_3-1597934185059.png

richbenmintz_4-1597934205783.png

 

Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

5 REPLIES 5
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

Essentially what you need to do is created a disconnected dimension that provides the users with a measure type to select, in your case {X,Y,Z}, then create a actual and forecast measure that returns the appropriate value based on the user selection, looking something like:

Actual = 
    IF(HASONEVALUE('metric selection'[Metric]),
    SWITCH(
            VALUES('metric selection'[Metric]), 
            "X", SUM(metrics[actual x]),
            "Y", SUM(metrics[actual y]),
            "Z", SUM(metrics[actual z])
), BLANK())

Forecast = 
    IF(HASONEVALUE('metric selection'[Metric]),
    SWITCH(
            VALUES('metric selection'[Metric]), 
            "X", SUM(metrics[Forecast x]),
            "Y", SUM(metrics[Forecast y]),
            "Z", SUM(metrics[Forecast z])
), BLANK())

You will find a sample pbix file here sample.pbix 

 

richbenmintz_0-1597934125887.png

richbenmintz_3-1597934185059.png

richbenmintz_4-1597934205783.png

 

Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Anonymous
Not applicable

Thanks @richbenmintz! Your solution was simple and elegant and solved my problem. Thanks so much!

Hi @Anonymous,

 

Happy to help



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


amitchandak
Super User
Super User

@Anonymous Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors