It’s always really dicey trying to write DAX without a PBIX file to look at the data, data model and test the measure on, but I’ll give this my best shot. If this doesn’t work, please post the PBIX and I’ll be happy to work through the full solution with you.
Thanks for posting your question @AliB. To receive a resolution in a timely manner please make sure that you provide all the necessary details on this thread.
Here is a potential list of additional information to include in this thread; demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.
Including all of the above will likely enable a quick solution to your question.