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! Learn more

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
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.