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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
shresthapuja
New Member

Aggregation issue in hierarchy matrix visual Power BI

Here, I have a table named Sales which includes 5 columns. I have created a matrix visual with managername, branch, and clientname which are shown in hierarchy. Qualifiedcondition and NotQualifiedcondition are the columns calculated using measure.

In order to identify qualified/not qualified client we have following condition:

if sum of profit >= 4000 then qualified if sum of profit < 4000 then not qualified

Data shown in the bottom level of hierarchy is as required but when I drill up, the data from both columns get added i.e. the value of qualifiedcondition and notqualifiedcondition are summed which is not what we require. We want values to be added only of a particular column when drilled up. Please advise.


Measure for Qualified Condition

Qualified condition = 
var _result =
switch(TRUE(),
    ISINSCOPE(Sales[clientname]),
    CALCULATE(
        if(  
            sum(Sales[profit])>=4000,
            sum(Sales[profit])
            )
    ),
    CALCULATE(
        sum(Sales[profit])
        )
)
return
if(ISBLANK(_result),0,_result)

Measure for Not Qualified Condition

Not qualified condition = 
var _selectedclient = SELECTEDVALUE(sales[clientname])
var _result = 
switch(TRUE(),
    ISINSCOPE(sales[clientname]),
    CALCULATE(
        if(  
            sum(sales[profit])<4000,
            sum(sales[profit])
            )
    ),
    CALCULATE(
            sum(sales[profit])
           )
)
return 
if(ISBLANK(_result), 0, _result)




Result:
result.png
Expected:
expected.png







 

2 REPLIES 2
_t0rres_9
New Member

I have similar case and I tried your measures as well. I have not found any solution for such cases as well. Hopefully someone will be able to help. 

Abyakta7
New Member

can use hasonefilter instead of isinscope function.

Mark as accepted if works. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.