Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mupiel
New Member

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:

 

powerbiimage.png

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


Example data:

 

powerbi2.png

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?
0 REPLIES 0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.