cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors