Forum Discussion

powerjey's avatar
powerjey
Helper I
4 years ago
Solved

How to dynamically calculate the cost difference between two dates per item?

Hi everyone,   Looking for some help to calculate the cost increase/decrease between two date points per product. I would like to display any increases/decreases per item. Each item in the list are...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  powerjey ,

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    var _min=MINX(ALLSELECTED('Table'),[Date])
    var _max=MAXX(ALLSELECTED('Table'),[Date])
    return
    SUMX(FILTER(ALL('Table'),'Table'[Date]=_max&&'Table'[Part#]=MAX('Table'[Part#])),[Price])
    -
    SUMX(FILTER(ALL('Table'),'Table'[Date]=_min&&'Table'[Part#]=MAX('Table'[Part#])),[Price])

    2. Result:

    If you need pbix, please click here.

    How to dynamically calculate the cost difference between two dates per item.pbix

     

    Best Regards,

    Liu Yang

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