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

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

Reply
noamshn
Frequent Visitor

Control line in a dynamic chart

Hello everyone,

i have a graph in which i want to insert a conrol line. in the dashboard there is a slicer to choose a range of dates and because of this i need that the control line will be dynamic.

for example if i choose a range of 2 days then the control line will be 6, and if i choose a range of 5 days then it will be 15 (3 for every day).

noamshn_1-1719286327226.png

 

so i succeed to create a measure that will count the number of days chosen, the problem is that for creating a control line i need to put the values in each record in the table but when i insert the measure in the column the output is always 1 although the measeure in a card is different.

I tried to create a control line using only a measure but coudnt succeed.

 

Thank you in advance.

1 ACCEPTED SOLUTION
fahadqadir3
Super User
Super User

@noamshn Review the attached screenshot based on Date Range selected Control Line would be updated.Screenshot_2.pngScreenshot_3.png

 

Days Difference = DATEDIFF(MIN('Table'[Date]),MAX('Table'[Date]),DAY)

Control Line = [Days Difference]*3

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! 

View solution in original post

4 REPLIES 4
fahadqadir3
Super User
Super User

@noamshn Review the attached screenshot based on Date Range selected Control Line would be updated.Screenshot_2.pngScreenshot_3.png

 

Days Difference = DATEDIFF(MIN('Table'[Date]),MAX('Table'[Date]),DAY)

Control Line = [Days Difference]*3

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! 

did you use line and clustered column chart? because in the card visual i see the value correct but in the chart the value is 0.

noamshn_0-1719298324803.png

 

@noamshn I'm using Clustered Column chart and use control line as a constant line. You can add constant line by using Analytics Pane. Please review the attached screenshot.Screenshot_4.png

 

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! 

Ritaf1983
Super User
Super User

Hi @noamshn 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

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

Helpful resources

Announcements
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