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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

count the days between 2 date columns for a given a name where time greater than 0

Below is the table i am working with and would like to get result on the last column 'count the days between columns '14 day' and 'saledate' for a given a name where time greater than 0'

 

 

SaleDateNameTime14Daycount the days between 14 day and saledate and time greater than 0
1/11/2019A6.76 0
1/11/2019B6.76 0
1/14/2019A8.00 0
1/14/2019B8.00 0
1/15/2019A8.00 0
1/15/2019B8.00 0
1/16/2019A7.99 0
1/16/2019B7.99 0
1/17/2019A7.97 0
1/17/2019B7.97 0
1/18/2019A7.88 0
1/18/2019B7.88 0
1/21/2019A8.15 0
1/21/2019B8.15 0
1/22/2019A7.95 0
1/22/2019B7.95 0
1/23/2019A8.15 0
1/23/2019B8.15 0
1/24/2019A8.00 0
1/24/2019B8.00 0
1/25/2019A7.881/11/201911
1/25/2019B7.881/11/201911
1/28/2019A8.001/14/201911
1/28/2019B8.001/14/201911
1/29/2019A7.941/15/201911
1/29/2019B7.941/15/201911
1/30/2019A8.321/16/201911
1/30/2019B8.321/16/201911
1/31/2019A7.991/17/201911
1/31/2019B7.991/17/201911
2/1/2019A7.011/18/201911
2/1/2019B7.011/18/201911
2/4/2019A7.991/21/201911
2/4/2019B7.991/21/201911
2/5/2019A8.051/22/201911
2/5/2019B8.051/22/201911
2/6/2019A8.011/23/201911
2/6/2019B8.011/23/201911
2/7/2019A7.881/24/201911
2/7/2019B7.881/24/201911
2/9/2019A6.341/26/201910
2/9/2019B6.341/26/201910
2/11/2019A7.971/28/201911
2/11/2019B7.971/28/201911
2/12/2019A7.981/29/201911
2/12/2019B7.981/29/201911
2/13/2019A6.991/30/201911
2/13/2019B6.991/30/201911
2/14/2019A8.001/31/201910
2/14/2019B8.001/31/201910
2/15/2019A7.952/1/201911
2/15/2019B7.952/1/201911
2/18/2019A8.002/4/201911
2/18/2019B8.002/4/201911
2/19/2019A7.992/5/201911
2/19/2019B7.992/5/201911
2/20/2019A7.832/6/201911
2/20/2019B7.832/6/201911
2/21/2019A7.952/7/201911
2/21/2019B7.952/7/201911
2/22/2019A7.922/8/201911
2/22/2019B7.922/8/201911
2/25/2019A8.002/11/201911
2/25/2019B8.002/11/201911
2/26/2019A8.002/12/201911
2/26/2019B8.002/12/201911
2/27/2019A7.842/13/201911
2/27/2019B7.842/13/201911
2/28/2019A2.782/14/201911
2/28/2019B2.782/14/201911
3/1/2019A7.782/15/201911
3/1/2019B7.782/15/201911
3/4/2019A8.282/18/201911
3/4/2019B8.282/18/201911
3/5/2019A7.962/19/201911
3/5/2019B7.962/19/201911
3/6/2019A7.982/20/201911
3/6/2019B7.982/20/201911
3/7/2019A7.992/21/201911
3/7/2019B7.992/21/201911
3/9/2019A5.942/23/201911
3/9/2019B5.942/23/201911
3/11/2019A7.962/25/201911
3/11/2019B7.962/25/201911
3/12/2019A6.242/26/201911
3/12/2019B6.242/26/201911
3/13/2019A8.302/27/201911
3/13/2019B8.302/27/201911
3/14/2019A7.712/28/201911
3/14/2019B7.712/28/201911
3/15/2019A8.003/1/201911
3/15/2019B8.003/1/201911
3/17/2019A0.003/3/201910
3/17/2019B0.003/3/2019

10

 

Please help.

2 REPLIES 2
Anonymous
Not applicable

this is what i have so far..and it works as long as the time > 0.00...

 

CALCULATE(
COUNT(table[time]),
DATESBETWEEN(table[SaleDate],table[14Day],table[SaleDate]),
ALLEXCEPT(table,Table[Name]),table[Time] > 0.00
)
 
but if the time is 0.00 as for date 3/17 it doesn't get a value.
Anonymous
Not applicable

HI @Anonymous ,

So you means you also want to calculate records who has zero time value?
If this is a case, you can modify your condition to replace operator '>' to '>=' to calculate records who greater than or equal to zero.(Current condition will ignore formula calculate with zero value records)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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