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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.