Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi!
Does anyone know how can I get the count for more than 15 days using the DATETIME and CountItem column? This is my current measure, I am not sure if this is the correct one.
Count_Morethan15Days = Calculate ( [CountItem] , DateDiff ( 'Table2'[DATETIME] , Now() , DAY ) >= 15 )
Solved! Go to Solution.
Hi @Anonymous ,
I think 'Table2'[DATETIME] should be in datetime data type. I suggest you to calculate the datediff based on hour instead of day. For example, in my sample ItemD has 1/16/2023 9:00:00 PM and now is 1/31/2023 5:21:00 PM. So datediff for ItemD is less than 15 days. The correct count should be 3, however your measure will return 4.
Please make sure both [CountItem] and [Count_Morethan15Days] should be measures.
CountItem = CALCULATE(COUNT(Table2[Item]))
Count_Morethan15Days = Calculate ( [CountItem] ,DateDiff ( 'Table2'[DATETIME] , Now() , HOUR )/24 >= 15 )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I think 'Table2'[DATETIME] should be in datetime data type. I suggest you to calculate the datediff based on hour instead of day. For example, in my sample ItemD has 1/16/2023 9:00:00 PM and now is 1/31/2023 5:21:00 PM. So datediff for ItemD is less than 15 days. The correct count should be 3, however your measure will return 4.
Please make sure both [CountItem] and [Count_Morethan15Days] should be measures.
CountItem = CALCULATE(COUNT(Table2[Item]))
Count_Morethan15Days = Calculate ( [CountItem] ,DateDiff ( 'Table2'[DATETIME] , Now() , HOUR )/24 >= 15 )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous