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
Casey_ONeal
Frequent Visitor

Need some assistance with DAX

Hi, I am somewhat new to Power BI and I could use some assistance with a calculation I need to do. Basically, I have two related tables let's call them Table 1 and Table 2. I need to calculate whether or not a date is less than or equal to another date if they are then return good if not then return overdue. Date1 <= Date2, Good, Overdue something along these lines.
1 ACCEPTED SOLUTION

OK, and the date fields are in one table each?

In this case, you could e.g. create a calculated column in Table1 with:
= IF(Table1[Date1] <= RELATED(Table2[Date2]), "Good", "Overdue")

View solution in original post

4 REPLIES 4
Michiel
Resolver III
Resolver III

 You'll need to provide some more details here. Your two tables are related, you say? Meaning there's a relationship between the two in the Power BI model? If so, on what fields? And if not, how would Power BI know which two dates to compare? There can be many in each table.

Yes, there is a 1:1 relationship in the Power BI model based on a field containing component names/codes which are unique identifiers.

OK, and the date fields are in one table each?

In this case, you could e.g. create a calculated column in Table1 with:
= IF(Table1[Date1] <= RELATED(Table2[Date2]), "Good", "Overdue")

Michiel, Thank you for the assistance here. Follow up question for anyone. Can you do the same thing with tables that have an indirect relationship?

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.