Forum Discussion

noamshn's avatar
noamshn
Frequent Visitor
2 years ago
Solved

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).

 

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.

  • noamshn Review the attached screenshot based on Date Range selected Control Line would be updated.

     

    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!! 

4 Replies

  • fahadqadir3's avatar
    fahadqadir3
    Solution Supplier

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

     

    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!! 

    • noamshn's avatar
      noamshn
      Frequent Visitor

      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.

       

      • fahadqadir3's avatar
        fahadqadir3
        Solution Supplier

        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.

         

        Hope it works.

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