Forum Discussion

OKgo's avatar
OKgo
Helper IV
2 years ago

Trouble with Line Chart Y-Axis Constant Line

I have a measure that works great for the "Line y-axis" on a "Line and clustered column chart". The returned value even adds itself into the legend which is awesome. 

 

Safety Stock = 
VAR CurrentItem = SELECTEDVALUE(Historical_Inventory_Trends[ITEM])
RETURN
CALCULATE(
    MAX(Item_Master[Safety Stock]),
    FILTER(
        Item_Master,
        Item_Master[ITEM] = CurrentItem
    )
)

 
When I try convert this to a "line chart" this measure will not work in the "Y-Axis Constant Line". It is simply returning zeros for all my small multiples. Any pointers as to what am I doing wrong? 

 

Histoical_Inventory_Trends
yyyy-MM-ddITEMQTY ON HAND
2024-01-01123450
2024-01-02123442
2024-01-03123438
2024-01-04123475
2024-01-05123462

 

Item_Master 
ITEMSafety Stock
123445

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi OKgo ,

    Can you provide a screenshot of the visual object you are currently having problems with?
    Also may I ask what you need to use the Y-Axis Constant Line for? Because specifically the Y-Axis Constant Line is not the same as the Line y-axis in the Line and clustered column chart, which corresponds to the Line Chart's Secondary y-axis.

    Best Regards,
    Dino Tao

  • Thank you for taking the time.

     

    The purpose of the line is to observe stock levels over time / weeks / months and display the current safety stock along side those visuals. 

     

    With the Line & Clustered column chart, I have no problem adding the blue line (safety stock). 

    In the line diagram - I was hoping the measure in the original post could replicate that blue line. But everytime I load the measure it just displays as zero. 

    Thanks again