Forum Discussion

joep78's avatar
joep78
Icon for Helper III rankHelper III
5 years ago
Solved

Calculate start value versus final period

Hi all,

 

I'm looking for a solution that calculate the difference between my start value and the target value in the final period:

 

Targetvalue
A1200
  
  
yearForecast
20201100
2021100
2022900

 

In this example I expect that answer will be 300 (1200 as target minus 900 of the final year) 

 

Not sure how to deal with this, could be simple but not for me! Thanks in advance for a reply. 

 

Regards, Joep

  • joep78 

    Create a measure as follows:

    M = 
    var __year = CALCULATE( max(table[year]) , all(table])) return
    
    var __lastvalue = CALCULATE( sum(table[forecast]), table[year] = __year )
    
    return
    
    max(target[value]) - __lastvalue




2 Replies

  • joep78 

    Create a measure as follows:

    M = 
    var __year = CALCULATE( max(table[year]) , all(table])) return
    
    var __lastvalue = CALCULATE( sum(table[forecast]), table[year] = __year )
    
    return
    
    max(target[value]) - __lastvalue




    • joep78's avatar
      joep78
      Icon for Helper III rankHelper III

      Hi Fowmy,

       

      Thanks for this solution, this is really helpful! 

       

      Regards,

       

      Joep