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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
SantoshKumar
Microsoft Employee
Microsoft Employee

create a line visual which shows target range and line trend as mentioned in the summary details.

Hi All,

I have to create a line visual which shows target range and line trend as mentioned below.

 

1.X-axis: display only latest 6 months data which should pop up automatically every time without manual changes

2.Y- axis: Blue line indicates percentage value of  Resolved Bugs out of Total Bugs. Condition applied is generic  for easy understanding and to build own user data to represent on the report.

3.Y-axis: Target line indicates fixed values which are decided at the beginning of the report formation and for current report-

         Consider : Oct – Dec : 50 % & Jan – Mar : 60 %

SantoshKumar_0-1619345089183.png

SantoshKumar_2-1619345146905.png

 

i came across median, mean lines but those lines will be applied throughout the visual which does not fits to my case. any help is apreciated.

 

Thanks

Santosh

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

Hi, @SantoshKumar 

According to your description and expected output, I think you can just use the line chart in Power BI to achieve this, you can try just place the columns within the sample data and set it like this:

v-robertq-msft_0-1619509167595.png

v-robertq-msft_1-1619509167596.png

 

Or you can try this measure to perform as the target line of the chart:

Target =

SWITCH(

    TRUE(),

    MONTH(MAX([Date]))>=10&&MONTH(MAX([Date]))<=12,0.5,

    MONTH(MAX([Date]))>=1&&MONTH(MAX([Date]))<=3,0.6,

    BLANK())

 

And you can get what you want.

We can not use the constant line of the chart to achieve this because the line runs through the entire picture and does not segment.

Analytics with Power BI Desktop Using Constant Lines

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @SantoshKumar 

According to your description and expected output, I think you can just use the line chart in Power BI to achieve this, you can try just place the columns within the sample data and set it like this:

v-robertq-msft_0-1619509167595.png

v-robertq-msft_1-1619509167596.png

 

Or you can try this measure to perform as the target line of the chart:

Target =

SWITCH(

    TRUE(),

    MONTH(MAX([Date]))>=10&&MONTH(MAX([Date]))<=12,0.5,

    MONTH(MAX([Date]))>=1&&MONTH(MAX([Date]))<=3,0.6,

    BLANK())

 

And you can get what you want.

We can not use the constant line of the chart to achieve this because the line runs through the entire picture and does not segment.

Analytics with Power BI Desktop Using Constant Lines

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

Greg_Deckler
Super User
Super User

@SantoshKumar Seems like you could just create one or two additional measures for the constant lines. You could build the date logic into the measure to display BLANK if out of desired date range and the constant otherwise.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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