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 Table DAX

Hi Everyone 

 

Trying to do a simple difference between two date in two Table and i can't understand the result i got

 

here i used the Dax Synthax 

Test = DateDiff(mAXX(RelatedTable('Base Facturation'),'Base Facturation'[Date]),Activities[0-D_Fbi],DAY)
in order to get a difference between "Date Controle Fibi" and "Date Facturation"
The result doesn't make any sense for me the first row should be 6 Day and he turned out 14 ....
 

Romain1768_0-1621495187851.png

 

Other think here i want the total to show an average aggregate not the total of day

For instance If i put a filter on Ruzziconi i want to have the total average difference between two date not the total number of day

 

I really hope that someone can help me on that

Thank you !!!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
Instead of creating a column, you may just try use a measure instead:

 

Measure = Datediff(MAX('Base Facturation'[Date]),MAX(Activities[0-D_Fbi]),DAY)

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous 
Instead of creating a column, you may just try use a measure instead:

 

Measure = Datediff(MAX('Base Facturation'[Date]),MAX(Activities[0-D_Fbi]),DAY)

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , first create a column this values is as expected or not

mAXX(RelatedTable('Base Facturation'),'Base Facturation'[Date])

 

if not check the join do you need additional join for that

you can get like, example

mAXX(filter('Base Facturation' ,Activities[ID] = 'Base Facturation' [ID] && Activities[ID1] = 'Base Facturation' [ID1] ,'Base Facturation'[Date])

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
Anonymous
Not applicable

@amitchandak 

It doesn't worked it said that i have Circular dependence when i'm trying to do the formula 

Both Table are link by the Back-up Number with a Several to Several one way link

Romain1768_0-1621498813699.png

 

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.