Forum Discussion

Daryn-TP's avatar
Daryn-TP
Regular Visitor
4 years ago
Solved

How to make a calculated column that calculates the difference between report dates

So I have data similar to the following example. I need to create a matrix like the second table example. My issue is I can't get a calculated column that calculates the % change between report dates...
  • amitchandak's avatar
    4 years ago

    Daryn-TP , Try a measure like

     

    Change % =
    var _date = maxx(filter(allselected(Table), [Location] = max(Table[Location]) && Table[Date] < Max(Table[Date])), [Date]) //Use all('Table') if one date is selected
    return
    Sum(Table[Memory Size]) - calculate(Sum(Table[Memory Size]),filter(allselected(Table) , [Location] = max(Table[Location]) && Table[Date] = _date))

     

    use all in place allselected if needed