Forum Discussion

mupiel's avatar
mupiel
New Member
3 years ago

Get Value for Day Prior including Filters

I am trying to get a column that will provide the value for the day previous so I can calculate change between dates while including filters.

 

Example visual:

 

Each item has a PriceID (represented by product name above) and a Status where there is a snapshot Total for everyday. 


Example data:

 

I've tried the following but it returns a blank result:

 
previous_amount =
VAR _PriceID =  SELECTEDVALUE('inventory_status_snapshot'[PriceId])
VAR _status =   SELECTEDVALUE('inventory_status_snapshot'[Status])
VAR _PDate =    SELECTEDVALUE('inventory_status_snapshot'[yesterday].[Date])
VAR _PAmt =      CALCULATE(
                SUM('inventory_status_snapshot'[total]),
                FILTER(
                    ALL('inventory_status_snapshot'),
                    'inventory_status_snapshot'[PriceId]= _PriceID
                    && 'inventory_status_snapshot'[Status] = _status
                    && 'inventory_status_snapshot'[date_only] = _PDate
                )
                )
return
     _PAmt
 
Is there a way to do this I am missing?
No RepliesBe the first to reply