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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
zubair242
Frequent Visitor

count number of items between 2 different date columns

Hi everyone,

 

I have an interesting scenario where I want to know whether property/asset is in the market or not. I have Date sold column which shows when it is sold. 

 

Now, I want to calculate available properties on a particular day. For example, there are 2 properties on 22nd, 4 on 23rd( 2 new and 2 previous), 3 on 24th(1 new, 2 from 23rd, but properties which were available on 22nd sold on 24th). How can I calculate using DAX. Snapshot is attached with the sample PBI file.

 

https://drive.google.com/file/d/170YhhUi8Ymtsygbb7Eb6mTF6qC1afTIv/view?usp=sharing

 

 

zubair242_0-1724994848467.png

 

Regards,

Zubair

 

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @zubair242 - as per shared pbix and given inputs , on 23rd aug, we ill get available properties only 2 not 4. can you please check and let know if something is missed

rajendraongole1_1-1724997370620.png

 

Available Properties =
VAR CurrentDate = MAX('DateTable'[Date])
RETURN
CALCULATE(
COUNTROWS(
FILTER(
'YourTable',
'YourTable'[Active] = 1 &&
(
('YourTable'[Date] <= CurrentDate && ISBLANK('YourTable'[Date Sold])) ||
('YourTable'[Date] <= CurrentDate && 'YourTable'[Date Sold] > CurrentDate)
)
)
)
)

 

rajendraongole1_2-1724997439739.png

 

Hope this helps.

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you @rajendraongole1 .. When I implemented this, I got the properties which are currently active. I should have 2 active on 22nd and 4 on 23rd but I got the following. The first 2 properties became inactive on 24th. Hope that makes sense?

 

Required output:

zubair242_1-1724998481561.png

 

 

Current output:

zubair242_0-1724998427175.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors