Forum Discussion

RobertKuij's avatar
RobertKuij
Frequent Visitor
6 years ago
Solved

Previousday function problem

Dear users,    I have been working on building a stock analysis dashboard, but I am struggling finding the previous day values as well as the percentage change. Problem   1) the Previousday funct...
  • amitchandak's avatar
    6 years ago

    RobertKuij , that will work better a Measure for  a new column try

     

    new column = sumx(filter(table, table[date]=earlier(table[date])-1),[closing])

     

    Use last, not the yesterday's date

    last Date= maxx(filter(table, table[date]<earlier(table[date])),[date])
    new column = sumx(filter(table, table[date]=earlier(table[last date])-),[closing])

     

     

    Measure can be like

    Last Day Non Continous = CALCULATE(sum('order'[Qty]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),Table['Date'])))
    Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))