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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Hoping
Helper III
Helper III

Line Chart with two constant Lines one for each legend category

I have a line chart drawn with a Year on the X-axis and a Measure on the Y-axis.

 

Aditionally, I have a field in the legend which give me 2 lines one for each category in the legend field.

 

Now I want to be able to display 2 constant lines one for each category.  When I use the Analytics pane, I am able to add only one field - Measure and so I am able to show just one constant line.

 

Is there a way to display 2 constant lines based on the legend field ?

 

 

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Hoping 
You can add multiple constants, just press "Add line" for every new line that you need.

Ritaf1983_0-1699759937596.png

pbix is attached.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @Hoping 
Technically - yes.
From an Efficient data visualization perspective, I don't recommend putting all this on 1 graph...
If I understood you correctly the result is 6 lines on the same graph ( 2 measures + 2 constants for every separate measure) it will be very challenging to read this kind of graph.
Maybe it will be better to create 2 separate graphs ...or to create the tooltip with the constants.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

This is not just about the quantity of lines; having two lines with two constants is akin to telling two stories in one sentence. When comparing two trends or categories in a chart, introducing constants can create confusion for the reader. It requires additional cognitive effort to discern which constant corresponds to each measure, diverting the reader's mental resources from the primary task of comparing trends. Regardless, the decision is yours. Technically, the answer is yes—having separate measures for each constant, just like in the Power BI file I attached in my initial response.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @Hoping 
You can add multiple constants, just press "Add line" for every new line that you need.

Ritaf1983_0-1699759937596.png

pbix is attached.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

The contant line I would like to display is the current year value for each category (the column in the legend).

 

I want 2 lines one for each category.

 

Should I be creating 2 measures one for each category ?

 

 

Hi @Hoping 
Technically - yes.
From an Efficient data visualization perspective, I don't recommend putting all this on 1 graph...
If I understood you correctly the result is 6 lines on the same graph ( 2 measures + 2 constants for every separate measure) it will be very challenging to read this kind of graph.
Maybe it will be better to create 2 separate graphs ...or to create the tooltip with the constants.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

That will be 4 lines - One line for each of the 2 categories plus 2 constant lines one for each category.

This is not just about the quantity of lines; having two lines with two constants is akin to telling two stories in one sentence. When comparing two trends or categories in a chart, introducing constants can create confusion for the reader. It requires additional cognitive effort to discern which constant corresponds to each measure, diverting the reader's mental resources from the primary task of comparing trends. Regardless, the decision is yours. Technically, the answer is yes—having separate measures for each constant, just like in the Power BI file I attached in my initial response.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.