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
nithinsakhamuri
Frequent Visitor

Adding columns in matrixI

Imagine I have the following tableImage 11-15-22 at 5.51 PM.jpeg

 

And I need a matrix like this: I tried adding the allocation and selection columns but no luck.

Image 11-15-22 at 5.53 PM.jpeg

Thank you very much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nithinsakhamuri ,

Please try below steps:

1. below is my test table:
Table:

vbinbinyumsft_1-1669275734521.png

2. create a measure with below dax formula

Measure =
IF (
    HASONEFILTER ( 'Table'[Calculation] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        'Table'[Calculation] = SELECTEDVALUE ( 'Table'[Calculation] )
    ),
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Calculation] IN { "Selection", "Allocation" }
        ),
        [Value]
    ) & "(allocation+selection)"
)

3. add a matrix visual with measure and field

vbinbinyumsft_2-1669275846860.png

set the column subtotal label:

vbinbinyumsft_3-1669275889725.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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

4 REPLIES 4
Anonymous
Not applicable

Hi @nithinsakhamuri ,

Please try below steps:

1. below is my test table:
Table:

vbinbinyumsft_1-1669275734521.png

2. create a measure with below dax formula

Measure =
IF (
    HASONEFILTER ( 'Table'[Calculation] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        'Table'[Calculation] = SELECTEDVALUE ( 'Table'[Calculation] )
    ),
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Calculation] IN { "Selection", "Allocation" }
        ),
        [Value]
    ) & "(allocation+selection)"
)

3. add a matrix visual with measure and field

vbinbinyumsft_2-1669275846860.png

set the column subtotal label:

vbinbinyumsft_3-1669275889725.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

It may be possible.  Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
nithinsakhamuri
Frequent Visitor

Thank you for the response.

Is there any way to add the attribute(allocation+selection) row in the Calculation Column?

 

vicky_
Super User
Super User

Try go to the settings and "Switch values to rows" under Values > Options.

vicky__0-1668555242945.png

 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.