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
Anonymous
Not applicable

How to draw Constant line using field value

Hello Experts,

 

I need your help in this. I have a bar chart, which shows sales according to the selection in the Slicer.

For eg, if we select State = Alberta, then bar chart dispalys the yearly increase in the Sales for Alberta.

For each state in the Slicer, we have a target value, called Statewide target, which is a field in my data source.

 

Now on my bar graph, i want to display a Constant Line, which is Statewide Target.

I have checked the Constant Line option in Analystics Pane, but it does not give my any option to add the field to pick the value.

 

Please help, how can i achieve this requirement.

 

Thanks.

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Write this measure

 

Target = MIN(Data[Statewide target])

 

Drag this to the visual and show it as a line.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Based on my test, if you use the constant line function I am afraid you could not achieve a dynamic value, could you have tried with Line and clustered column chart to add a line value?

And could you post your sample data and your desired result if possible that I could test for you?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.