Parent Category in Matrix - Incorrect Result

I have written Dax to get the values of earlier “Sub-Category” value on the basis of “Sort-Id”, wherein I am getting right result on “Sub-Category” level but the “Category” level total is not showing correct result.

Attaching PBIX file along with feeding excel as well.

Previous.pbix (48.3 KB)
Book2.xlsx (200.2 KB)

Hi @wwx.raj66 ,

welcome to Forum.

DAX is calculated based on context and your OFFSET formula 2a what is in the Sort_id -1

For 450 - it calculates all what is in Sort_id = 4-1 = 3 (no matter what Sub-Category for Category C - not just Sub-categories 1,2,3 but also 4 and5)