To make it simple I have to tables connected with 1-M relation. One has distinct order numbers, the second connected via order number have shipment numbers. One order can have many shipment numbers. I built matrix with order number (from table1) and shipment number (from table2)
At every shipment number row I would like to have number of all shipment for this order number. So If there are ie. 2 shipment under 1 order I would like to have “2” at every shipment number row. Sounds simple. I just want to ignore shipment number filter coming from matrix but I cannot achieve that. My 1st measure:
Shiping count per order 1 =
CALCULATE(
DISTINCTCOUNT(
‘Sales_shipment_item (DN)’[(DN) ← sales_shipment.increment_id]
),
ALLEXCEPT(‘Order ID Distinct’,‘Order ID Distinct’[increment_id]))
shows the same “1” at every row. Why it works like that? ALLEXCEPT should remove all filters except the one for order number ?
Result:
The second measure:
Shiping count per order 2 =
CALCULATE(
DISTINCTCOUNT(
‘Sales_shipment_item (DN)’[(DN) ← sales_shipment.increment_id]
),
ALL(‘Sales_shipment_item (DN)’[(DN) ← sales_shipment.increment_id]))
result in showing all possible shipment number under every single order. Why?
result:
How to get correct result?