DAX concepts / Filter behaviour

I am having question which i didn’t think before,but i am not sure the way i think is correct.

Scenario 01

I am having three tables(company,customer and fact table called tnx) ,total Ar amount is just sum of tnx.I have a relationship to company to fact and customer to fact as star schema.

When i select company code from company table as slicer, total is changing .that is obvious,but how customer figures are changing cos there is no direct relationship with company and customer and direction is also uni directional .Is that company filter fact table and then as reverse filter, fact table filter out customer. I just want to know the way i think is correct.Customer is indirectly filter by company via fact as i understood.

nalakanayana_2-1695793174927
nalakanayana_1-1695793158895

Scenario 02
nalakanayana_3-1695793198322
nalakanayana_4-1695793205026
This uses also same three tables ,customer company and fact .Here i rank amount based on customer parent id (1 st column)
The DAX i used =

var _step1 =
IF (
ISINSCOPE ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
IF (
HASONEVALUE ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
RANKX (
ALLSELECTED ( CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] ),
CALCULATE (
[Total AR Amount],
ALLEXCEPT ( CUSTOMERS, CUSTOMERS[CUSTOMER_PARENT_ID_REPORTING] )
),
,
DESC,
DENSE
)
)
)

So I get the values as in 6 th column and 7 th column is just sum(amount) as 1st scenario. What i am going to achieve is customer parent level ranking based on amount.But what happen if i slice by company code.Company code column is not on visual
But when i click company code slicer for a particular company code i can see value changes also parent id changes.But the DAX, i wrote to calculate [Total AR Amount] i wrote with ALLEXCEPT,so it remove all filters except Customer parent id.
But since i have used allselected for customer_parent _id reporting now how this flows goes on.This is difficult to understand how this is behaving now with rank.I am not sure the final answer i am getting is right.what i finally want is dynamcially rank based on external slicers and show the total based on customer parent

Can you help me with this.