Forum Discussion

flownfluid's avatar
flownfluid
Frequent Visitor
5 years ago
Solved

Showing difference between two rows with date selection

Hi all,   I have a table like this: Materialnumber Date Value 100 01.01.2021 100 100 02.01.2021 100 100 03.01.2021 200 The goal is that the user can select 2 dates and Po...
  • amitchandak's avatar
    5 years ago

    flownfluid , assuming dates are selected in a single  slicer

     

    measure =
    Var _Min = MINX(allselected('Date'), 'Date'[Date]) //date table assumed
    Var _Max = MAXX(allselected('Date'), 'Date'[Date])
    return CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[date]=_max)) -CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[date]=_min))