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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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