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
Fiala
Helper II
Helper II

counting days

Hellou, I have a problem with calculated column.
I have created this:

in how many days =
var val = 'Tab1'[Calling_Number]
var thisdate = 'Tab1'[CC_Call_Start_Day]
var nextdate = CALCULATE(min('Tab1'[CC_Call_Start_Day]),ALLEXCEPT('Tab1','Tab1'[Calling_Number]),'Tab1'[CC_Call_Start_Day]>thisdate)
var daysCount = CALCULATE(DATEDIFF(thisdate,nextdate,DAY),'Tab1'[Calling_Number]=val)
return
daysCount
 
But the result is wrong. I have a problem if calling_Number calls more then one a day.
Fiala_0-1614682225575.png

 


I have 2 million lines in the feed, so I'd rather avoid the value of time. It's very slow.
2 REPLIES 2
Fiala
Helper II
Helper II

@amitchandak Thank you. I added an INDEX column. But I don't know how to use it. I need to calculate the difference between two dates, so I have to use dates as well. The date column also has time, but when I work with time, the calculation stops when there is not enough memory.

amitchandak
Super User
Super User

@Fiala , does calling CC_Call_Start_Day has timestamp(some other date), if not add an index column and use it (Use in place of date)

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

Column will slow as this will this as column at the load time, but post that it should be fast.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.