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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Need Help Using Slicer to Calculate Difference Between Two Dates

Hi Everyone -

 

I'm looking for help to use a slicer to dynamically calculate the difference between the two dates selected. This is for my "office market statistics project." Specifically, I'm looking to easily show the difference in absorption once a user chooses two dates.

 

Absorption is calculated by the difference in occupied square feet over a given period - it can be positive or negative. Occupied SF is calculated by subtracting the vacant SF from the "rentable building area (RBA)."

 

So for the situation below, the dates are 7/1/2014 - 4/1/2015, and in card visual below, it would display "3,486,142."

 

Occupied SF in 4/1/2015 = 136,426,764

Occupied SF in 7/1/2014 = 132,940,621

Absorption = 3,486,142

 

 

a.PNG

These numbers/stats will be updated each month and will all be in the same table. Any help would be greatly appreciated!

Thanks,

Paul

 

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

@OwenAuger's solution is correct. Just use LASTDATE() calculation minus the FIRSTDATE() calculation.

 

5.PNG

 

Regards,

OwenAuger
Super User
Super User

Hi Paul @Anonymous

 

I'm assuming you have a date table called 'Date' with date column 'Date'[Date], otherwise rename.

 

Also you've already defined an [Occ SF] measure by the looks of it.

 

Then a measure something like this should do the trick:

 

Absorption Between First and Last Date =
CALCULATE ( [Occ SF], FIRSTDATE ( 'Date'[Date] ) )
    - CALCULATE ( [Occ SF], LASTDATE ( 'Date'[Date] ) )

 

Owen 🙂


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.