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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Matrix visual query

Hi Folks,

I have hierarchy in matrix visual,  where i want same total (7155.62) in Advisory & NY -New york city.

 

UI_0-1647411762443.png

 

Staff_Target = SWITCH(

TRUE(),

HASONEVALUE(Employees[StaffName]) && HASONEVALUE(Employees[StaffBusinessUnitName])

&& HASONEVALUE(Employees[StaffPosition]) && HASONEVALUE('Calendar'[Month (MMMM)]),[Target],

CALCULATE(

SUMX(Employees,

[Target]),

 

VALUES(Employees[StaffName]) ))

@amitchandak @lbendlin  @amitchauhan  @parry2k  @AlexisOlson  @AllisonW 

 

Regards,

Pratik.S

 

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

The value of the hierarchy in the matrix visual can be customized by HASONEVALUE. See the following screenshot to see if this is the result you expect:

M = SUM(Table_test[Value])
M_ =
VAR sum_id =
    CALCULATE (
        SUM ( Table_test[Value] ),
        FILTER ( ALL ( Table_test ), Table_test[ID] = MAX ( Table_test[ID] ) )
    )
RETURN
    IF (
        MAX ( Table_test[Category1] ) = "a1",
        sum_id,
        IF ( HASONEVALUE ( Table_test[ID] ), [M] )
    )

vhenrykmstf_0-1647851458709.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

The value of the hierarchy in the matrix visual can be customized by HASONEVALUE. See the following screenshot to see if this is the result you expect:

M = SUM(Table_test[Value])
M_ =
VAR sum_id =
    CALCULATE (
        SUM ( Table_test[Value] ),
        FILTER ( ALL ( Table_test ), Table_test[ID] = MAX ( Table_test[ID] ) )
    )
RETURN
    IF (
        MAX ( Table_test[Category1] ) = "a1",
        sum_id,
        IF ( HASONEVALUE ( Table_test[ID] ), [M] )
    )

vhenrykmstf_0-1647851458709.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.