Forum Discussion

cosmicyes's avatar
cosmicyes
Icon for Helper II rankHelper II
4 years ago
Solved

Adding a dynamic constant line to barchart using ISINSCOPE

Hi all,

 

I have got a barchart with a date hierarchy (date, week, month, year).
I want to add a constant line as "target". But the values for target depend on if in the barchart year is selected or month or week...

On YouTube I found a solution - but it just does not work for me ๐Ÿ˜ž

What I have done:

 

- created a measure:

Target = 
SWITCH(
    TRUE(),
    ISINSCOPE('Kalender'[Date]),50,
    ISINSCOPE('Kalender'[Week]),250,
    ISINSCOPE('Kalender'[Month]),1000,
    ISINSCOPE('Kalender[Year]),12000
)

- in the barchart settings added a contant line on Analytics pane.
Under "Line" I pressed the fx-Button and added the measure.

 

The constant line is visible but it is always set to 0 - whatever I choose to drill down.

What could be my mistake?

 

2 Replies

  • cosmicyes , I doubt constant line can check isinscope , try clustered line visual and use the meausre for line

    • cosmicyes's avatar
      cosmicyes
      Icon for Helper II rankHelper II

      I think you are right - it does not work the way I planned.
      Now I am using "Line and stacked column chart" and everything works fine.
      Thank you!