Forum Discussion

JoaoPGomes's avatar
JoaoPGomes
Frequent Visitor
6 years ago
Solved

Compare forecast values in different months

Hi all,   I need creat a tool to compare the differencies values between months. So, for example I have a forecast in february of these values for this projects. COD_PROJ 31/01/2020 29/02/202...
  • camargos88's avatar
    6 years ago

    Hi JoaoPGomes ,

     

    Check this file:  Download PBIX 

     

    You need this measure:

    _diff =
    VAR _minDate = MINX(tb_data; tb_data[DateSnapshot])
    VAR _maxDate = MAXX(tb_data; tb_data[DateSnapshot])
    RETURN
    CALCULATE(SUM(tb_data[Value]); FILTER(ALL(tb_data[DateSnapshot]); tb_data[DateSnapshot] = _maxDate)) -
    CALCULATE(SUM(tb_data[Value]); FILTER(ALL(tb_data[DateSnapshot]); tb_data[DateSnapshot] = _minDate))
     
    Did I answer your question? Mark my post as a solution!
    Ricardo