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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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