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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

date difference between two columns on two different rows.

Bonjour

Merci d’avance pour votre aide.

Je cherche une formule qui calcule dans Power BI la différence entre deux dates de deux colonnes et pour des lignes différentes.

Date de début Date de début Date de
fin 1 11/11/2021 11/11/2021
2 11/11/2021 15/11/2011
3 15/11/2021 17/11/2021
4 14/11/2021 18/11/2021
5 20/11/2021 26/11/2021
6 25/11/2021 27/11/2021
7 12/12/2021 20/11/2021

J’aimerais calculer la différence de date entre la date de fin de la ligne 4 et la date de début de la ligne 5 et la même chose pour les lignes 6 et 7 et en jour ouvrable si possible.

Étant nouveau, je n’ai pas réussi à le faire ou à trouver une solution sur internet.

Merci d’avance pour votre aide.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

a new column =

datediff([end date], maxx(filter(Table, [Index] = earlier([Index]) +1 ) , [Start Date]) , day)

 

or

 

a new column =

networkdays([end date], maxx(filter(Table, [Index] = earlier([Index]) +1 ) , [Start Date]) , 1)

 

https://amitchandak.medium.com/power-bi-dax-function-networkdays-5c8e4aca38c

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,

a new column =

datediff([end date], maxx(filter(Table, [Index] = earlier([Index]) +1 ) , [Start Date]) , day)

 

or

 

a new column =

networkdays([end date], maxx(filter(Table, [Index] = earlier([Index]) +1 ) , [Start Date]) , 1)

 

https://amitchandak.medium.com/power-bi-dax-function-networkdays-5c8e4aca38c

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.