Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Julia1234
Frequent Visitor

Matrix problem with [go to the next level in the hierarchy] - not needed summing

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!

2 ACCEPTED SOLUTIONS

@Julia1234  I have made changes to the rate of views please

 

measure = IF( ISINSCOPE('table'[Transport]), SUM('table'[Quantity]), AVERAGE('table'[Quantity]))

 

DimaMD_0-1693405400697.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

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.

View solution in original post

4 REPLIES 4
DimaMD
Solution Sage
Solution Sage

Hi @Julia1234  try it

 

 

measure = 
 IF( ISINSCOPE('table'[Transport]), SUM('table'[Quantity]), AVERAGE('table'[Quantity]))

 

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

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]))

 

DimaMD_0-1693405400697.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.