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
Amitkr174
Helper III
Helper III

How to find a difference between two dates which has no relation???

Hi,

Could someone please explain how to find a difference between two dates which has no relation??

I have two tables Project and opportunity which has no relation.

I am using the below DAX

Days Diff=

VALUE( DATEDIFF(LASTNONBLANK(Project[Project Start Date],1),LASTNONBLANK(Opportunity[Close Date],1),DAY))
4 REPLIES 4
TeigeGao
Solution Sage
Solution Sage

Hi Amitkr174,

Based on my test, we can use the following DAX if two dates has no relation.

Days Diff = DATEDIFF(LASTNONBLANK(Project[Project Start Date],1),LASTNONBLANK(Opportunity[Close Date],1),DAY)

The result will like below:

1111111.png

Best Regards,

Teige

Hi,

 

This is not wokring where objects has no relation. I aleady tried this DAX, but it is not giving me the expected results.

I using direct query here on which I have no control. 

Could you please share the pbix to us for analysis? In my environment, it works.

222222.png

I think the pbix file won't open at your end as it is connected to the SSAS cube whose access is restricted to the external users.

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.