cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Resolver III
Resolver III

Re: Need some assistance with DAX

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
Highlighted
Resolver III
Resolver III

Re: Need some assistance with DAX

 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.

Highlighted
Frequent Visitor

Re: Need some assistance with DAX

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

Re: Need some assistance with DAX

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

Highlighted
Frequent Visitor

Re: Need some assistance with DAX

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
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors