Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi I have a table like below to show logistics for the Shipment Order where same Shipment order and same quantity gets shipped using multiple transport types.
Shipment_Order | Customer | Transport | Quantity
SO123 | Smith | Boat | 110
SO123 | Smith | Plane | 110
SO123 | Smith | Car | 110
In power BI, I use Matrix with the group rows (levels) and Sum(Quantity) as measure:
Transport
Customer
Shipment_Order
It all works until users start using [go to the next level in the hierarchy] drill down (two downside arrows on top right corner of the matrix).
As it drill downs to the next level and ignores all parent groupings(Transport).
For example, if drilled down to Shipment_Order level the Sum(Quantity) will double dip on the same:
shipment:
Shipment_Order | Quantity
SO123 | 330 (110+110+110) - but should be 110
It is not possible to disable this drill down feature. How Quantity measure could be tweaked not to double dip on the same Shipment_Order? Or may be this could be set in Matrix somehow? please advise.
Thank you!
Solved! Go to Solution.
@Julia1234 I have made changes to the rate of views please
measure = IF( ISINSCOPE('table'[Transport]), SUM('table'[Quantity]), AVERAGE('table'[Quantity]))
Thank you @DimaMD , your solution worked better than the one I suggested above.
I tweaked it a bit and used HASONEVALUE instead of ISINSCOPE, tested and it worked with real life numbers:
_Quantity =
VAR Qty = SUMX(values('Table'[Shipment_Order]),calculate(MAX('Table'[Quantity])))
RETURN IF(
HASONEVALUE( 'Table'[Transport]),
SUM('Table'[Quantity]),
Qty
)
Thank you for your help.
Hi @Julia1234 try it
measure =
IF( ISINSCOPE('table'[Transport]), SUM('table'[Quantity]), AVERAGE('table'[Quantity]))
Thank you for the prompt response @DimaMD
I tested the solution but it still resulted in double summing unfortunately.
I also tried this formula
_measure = SUMX(values('table'[Shipment_Order]),calculate(MAX('table'[Quantity]))) and it so far it calculates correctly, will do more testing.
Again , many thanks!
@Julia1234 I have made changes to the rate of views please
measure = IF( ISINSCOPE('table'[Transport]), SUM('table'[Quantity]), AVERAGE('table'[Quantity]))
Thank you @DimaMD , your solution worked better than the one I suggested above.
I tweaked it a bit and used HASONEVALUE instead of ISINSCOPE, tested and it worked with real life numbers:
_Quantity =
VAR Qty = SUMX(values('Table'[Shipment_Order]),calculate(MAX('Table'[Quantity])))
RETURN IF(
HASONEVALUE( 'Table'[Transport]),
SUM('Table'[Quantity]),
Qty
)
Thank you for your help.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |