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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Swiftglade
Frequent Visitor

Create column based on difference between two dates from two tables

Hi,

 

I am trying to create a Calculated column to track the difference between two dates from two different columns. The goal is to find when a shipment has been recieved (Final Merger) and when the product has been recieved and put away (Export Worksheet). I am trying to create a calcuated column using an if statement, however i run into the error.

 

The If statement is created within Export OR Final Merger

1. Wont allow me to select multiple tables in my If Statement. If I select either fields, I wont be able to select the other table.

2. Error - "Cannot Find (Column Name)

 

Tables 

 

TableColumnType
Final_MergerFirst DateDate
Export WorksheetSecond DateDate
Date DimensionDateDate

 

References 

First TableSecond TableColumn Relationship 
Final_MergerExport Worksheet
Receipt ID
Many to Many
Final MergerDate DimensionDateMany to One

 

 

2 REPLIES 2
Fowmy
Super User
Super User

@Swiftglade 

I suggest you avoid creating Many-to-Many relationships. If you can share the formula, it will be clear enough. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy ,

Many to Many relationship comment- 

I will look into cleansing the data, but we recieve it with values that have duplicates, from Receipt ID to another version of Receipt ID. At the moment, we cannot cleanse it and must have it as Many-Many. 

 

Formula- 

We are trying to get the First Date from "Final Merger", and compare the date to Export Worksheet.
So for example, We have "Frist Date, which is June 23. We want to know the when the next workday is,
so we created a column in our Date Table to have the next work day.
We then want to compare if the date the product was received (Second Date) is on time or not on time.
Our goal was to do an Greater than if statement.

Another example below.

IF(Second Date>Next Workday),"Shipment has passed date","Shipment was received on time")

Final MergerExport Worksheet 
FirstInventory StoredNext Workday
2021-02-10 0:002021-02-11 0:002021-02-11 0:00

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors