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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cosmicyes
Helper II
Helper II

Constant Line in column chart does not work with measure using ISINSCOPE

I thought this would be easy but it isn´t 😉

 

I have a stacked column chart where you can drill up and down from date / week / month / year.
What I need is a constant line for showing a goal depending on if week or month... or whatever is chosen.

I have created a measure:

 

 

GOAL = 
SWITCH(
    TRUE(),
    ISINSCOPE(Kalender[Date]),10000,
    ISINSCOPE(Kalender[Week]), 50000,
    ISINSCOPE(Kalender[Month]), 200000,
    ISINSCOPE(Kalender[YEAR]),2400000
)

 

 

Then I created a Constant line and added the measure using the fx-icon
(Format style "Field value", What field should we base this on? "Goal")


The constant line appears but the value is always 0, no matter what I drill through.

 

Just to test my measure I have changed the visual to Line and stack column chart and used the measure for Y-Axis - there it works! But this is not what I want.

Any ideas? Thank you in advance!

1 ACCEPTED SOLUTION

Hi @cosmicyes ,

I don't mean for you to create a fixed line value. I just want to explain why the line always stays on 0, because constant line can't tell which level the X-axis is at. So, Line and stack column chart maybe the only way you can do it.

 

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @cosmicyes ,

Because for constant line, it can't tell which level the X-axis is at. If you add a ELSE value in the SWITCH formula, it can return that value like below.

vyanjiangmsft_0-1686209666287.png

Best Regards,
Community Support Team _ kalyj

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

 

Dear @v-yanjiang-msft ,
thank you for your input.
But this way I always have the same constant line, no matter if week, month or whatever is selected. This is unfortunately not what I need.

Hi @cosmicyes ,

I don't mean for you to create a fixed line value. I just want to explain why the line always stays on 0, because constant line can't tell which level the X-axis is at. So, Line and stack column chart maybe the only way you can do it.

 

Best Regards,
Community Support Team _ kalyj

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

Hi @v-yanjiang-msft 
ah, I see. There was some misunderstanding on my side 🙂
Thank you for your very quick reply and please excuse that it took me so long to reply on your first post.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.