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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mHarbo
New Member

I have problem regarding the datediff

I have problem regarding the time difference between two dates. 

 

The dax code is:

DATEDIFF([AssignedDate],CALCULATE(Min([Modified]), [RevisionNumber]>[RevisionNumber]+1),HOUR)

 

The reason for this is that i want to calculate the time between when a "rask" is assigned and when its modified. When a task is modifed it gets a revision number and that number increases each time it's modified.

3 REPLIES 3
amitchandak
Super User
Super User

@mHarbo , Try a new column like

DATEDIFF([AssignedDate],MinX(filter(Table,[RevisionNumber]>earlier([RevisionNumber])+1),[Modified]),HOUR)

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
wdx223_Daniel
Super User
Super User

@mHarbo 

=VAR _rn=[RevisionNumber] RETURN DATEDIFF([AssignedDate],MINX(FILTER(Table,[RevisionNumber]>_rn+1),[Modified]),HOUR)

Anonymous
Not applicable

I guess this is a formula in a calculated column? If so, then you'd be much better off moving the calculation to Power Query. Invoking measures on big fact tables row-by-row is one of the worst things you can do in Power BI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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