Forum Discussion

Angus01's avatar
Angus01
Regular Visitor
2 years ago
Solved

Point at which two lines converge

I have two lines on a graph, one of which is dynamic based on some "what if" parameters. I want to find the point on the x axis where the 2 lines meet. 

 

https://www.dropbox.com/scl/fi/oo3kn2eucet5ciz1k9o4c/crossover_query.pbix?rlkey=30ydsihjb3bpkzh9gysqe3g84&st=b8gj3u7e&dl=0

 

Any help much appreciated!

  • So I took your inspiration and managed to get it to work using: 

    backlog_crossover_date = 
    
    var crossover = MAXX('Calendar Table', if([Forecast Plus Backlog] - [Regression line by hours] > 0, 'Calendar Table'[Date], date(2000, 1, 1)))
    
    var result = if(crossover <= DATE(2025, 3, 30), crossover, "No Crossover")
    
    
    RETURN
    
    result

     

    it may not be the most elegant but it works!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, I tried with the below measure

    Difference =
    var diff = 'Average of Running total, Regression line by hours, Forecast, Forecast_plus_back'[Average baseline] - 'Average of Running total, Regression line by hours, Forecast, Forecast_plus_back'[Average regression]
    var result = IF(diff<0,diff)
    RETURN
    result

    Got result like below image. 

    I kept the Difference measure in Y-Axis.
    So, from intersection point to end of the line the ornge line is displaying.

    Hope this will works somewhat for you!!


    Regards,
    Chiranjeevi Kudupudi

    • Angus01's avatar
      Angus01
      Regular Visitor

      Thank you for this. It feels like a step in the right direction but what I am really trying to do is get a single value for the first point of conversion, such that I can display it on a card or similar. 

       

      • Angus01's avatar
        Angus01
        Regular Visitor

        So I took your inspiration and managed to get it to work using: 

        backlog_crossover_date = 
        
        var crossover = MAXX('Calendar Table', if([Forecast Plus Backlog] - [Regression line by hours] > 0, 'Calendar Table'[Date], date(2000, 1, 1)))
        
        var result = if(crossover <= DATE(2025, 3, 30), crossover, "No Crossover")
        
        
        RETURN
        
        result

         

        it may not be the most elegant but it works!