Count Orders by Latest Order Status

This model doesn’t look right to me and is likely why there’s still a bit of confusion.

First it’s unlike the inactive relationship from dates to the order history is what’s required.

To me both your Orders and Order Status History are two seperate fact tables. You should have then at the same level and both have active relationship with the date table. Both one to many as well, with the one side being the date table.

Once this is setup the formula shouldn’t be too difficult.

Once you have this then all you need to do is calculate the last order status name within the specified context and from this use a relatively simple CALCULATE/FILTER logic.

Getting the model setup correctly here is the main piece of the puzzle.

Once that is setup correctly give the above logic another go.

If still stuck a demo model of the scenario would be the best as things could be looked at quickly from there and better solutions provided.

Here’s some formula examples that may help

https://blog.enterprisedna.co/2018/09/14/compare-one-sale-versus-the-last-sale-no-time-intelligence/