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
CupidC
Helper II
Helper II

Display two values on the Y-Axis of a Line chart while a legend is active

Hello all,

I'm in search of a solution to display two values on the Y-Axis of a Line chart while a Legend is active.

 

My ultimate goal is to include a forecast line in the chart below, distinguished by a different color.


I've tried several approaches, such as combining actual and forecast values, but this doesn't allow for changing the color of the forecast months. I've also experimented with the Error Bar method, which fails to display if a month lacks actual data.

I'm considering the possibility of utilizing Field parameters but am uncertain how to proceed. Any advice would be highly appreciated.

CupidC_0-1708489364575.png

 




1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @CupidC,

You can create a new table with table 1 and table 2 legend value to use this new table field on chart legend.

Then you can write a measure formula to switch and lookup records from different tables to use current x-axis and legend values as conditions.

Write Conditional Statement Using SWITCH in DAX and Power BI - RADACAD

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @CupidC,

You can create a new table with table 1 and table 2 legend value to use this new table field on chart legend.

Then you can write a measure formula to switch and lookup records from different tables to use current x-axis and legend values as conditions.

Write Conditional Statement Using SWITCH in DAX and Power BI - RADACAD

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
tharunkumarRTK
Solution Sage
Solution Sage

Not possible. In a line chart either you can put one measure in y axis with legend enabled or multiple measures in Y - axis field.

_AAndrade
Super User
Super User

Hi,

Probably I'm not understanding your question, but if you put the forecast measure on the x-axis on the line chart visual doesn't work?

Hi AAndrade

 

Thanks, hmm it will not work, x-axis is the month column, and y-axis only take one single measure as i have a legend

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.