'How to create a measure that compares two dates from two separate tables

I have two tables one is a date table and for sake of simplicity the other looks like this

Location Open Date Close Date
Atlanta 10/23/2001 11/25/2020
New York 03/14/2005 01/20/2019

I'm trying to create a matrix visual in Power BI that looks like this

          | 09/2020 | 10/2020 | 11/2020 | 12/2020
| Status  | Open    |  Open   |  Open   |  Closed

I currently have a slicer that only allows one Location at a time to be selected for the matrix which I believe simplifies things

Now my actual issue is that I'm having trouble creating a measure that allows me to use logic to say if the month & year shown in the Matrix's Date column (which comes from the date table) is >= the month and year of the Open Date for the property in Question && < the month and year of the Close Date the show "Open" etc.

I have tried a variety of SWITCH and IF functions along with SELECTEDVALUE to get this to work but have not yet gotten the correct results. I am still fairly new to PowerBI so I'm not completely sure of what I don't know.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source