Forum Discussion

siva54's avatar
siva54
Helper I
4 years ago
Solved

Trend value by previous dates

Hi Team,   I need a built a visual like this in power bi.   need to calculate trend by comparing with thier prrevious date value.       Please provide a solution to get the same view or...
  • amitchandak's avatar
    4 years ago

    siva54 , You can have measures like

     

    This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
    Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
    Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))

    diff =[This Day] - [Last Day]

     

    You can use that with Date on column with this day (that can by simple sum measure ) and diff with icon formatting

     

    Date should be used from date table

     

    Date as Dateadd - Decoding Date and Calendar 5-5 - Power BI Turning 5 Celebration Series
    https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power-BI-Turning/ba-p/1187827