Forum Discussion
Using an IF statement comparing two date fields in two different tables
- Anonymous7 years ago
Just wanted to let everyone know that I figured it out, not with DAX however. I copied the master table, pasted it to a new Excel file, deleted everything but the date, name and location field. Made the date field to contain all the dates in the range for each person (so 365 days for all 22 people, 365 * 22) . I then in Power Bi created a key column in each table. Key = Concatenate([Name], Concatenate(" - ", [Date]). I created the relationship based on the Key column in each table. From there I was able to get a one to one relationship and use the Related() funtion comparing the Date table to the able with the Peoples work days.
Thank you everyone for your help. :)
Thank you all for replying.
The first table (Table1) looks similar to this . With a lot more people and a lot more dates.
The second table (Date Table) looks similar to , again with a lot more dates.
The final table I am aiming to acheive after the DAX expression should look something like .
Sorry for the long reply but I think the visuals will help.
- jdbuchanan717 years agoSuper User
Give this measure a try, it should do what you are looking for.
Working = VAR HasDate = COUNTROWS(Table1) RETURN IF ( ISBLANK(HasDate), "N","Y")