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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.