It’s my pleasure to answer for you.
According to your description,There is no problem with your formula,so the problem may appear in your data or visual.
Could you mind providing some sample data with onedrive or others? So we can help you soon.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.