If I understand correctly the desired result is to create the new dimension 'Flag' which will contain a 1 for each of the rows where 'LocationID_DIM' and 'LocationID_FACT' are matching.
The following calculation should provide the information as desired, creating the third column, named 'Flag'.
EDIT: I have attached a packaged workbook with a demonstration.
Hope this helps!
QuickExample.twbx 11.3 KB