Forum Discussion

arunbyc's avatar
arunbyc
Helper III
1 year ago
Solved

why does measure affect filter context in matrixI

I have three tables Project -----> Order  ----- > Work  ---> (This gets linked to other tables later) Structure of the tables: Project : Project_Id, name   Order :  Project_Id, Order_Id, Est_Quant...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi arunbyc ,

     

    I think your issue should be caused by the relationship between Order Table and Work Table.

    Here I create a sample:

    In my sample Order[Order_Id] connect to Work[Order_Id] (one to many)

    Result is similar like yours:

    You can update your measure as below.

    Rate = CALCULATE(DIVIDE(sum('Order'[Est_Amount]),sum('Order'[Est_Quantity])),CROSSFILTER('Order'[Order_Id],'Work'[Order_id],Both))

     

    I am confused to your data model. I think Work Table should be a DimTable for Order Table like Project Table.

    Can an order id correspond to more than one work id and name, otherwise I think the relationship should be one to one.

    If relationship looks like as below, your measure works.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.