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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
henryco88
Helper II
Helper II

Total column at the beginning of the matrix table

Hi,

How can i put the total column at the beginning of the matrix table?

henryco88_0-1606916353173.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @henryco88 ,

 

Based on my test, it is not supported in Power BI currently. You can vote this similar idea: Table / Matrix: Total Column on first position.

 

In addition, you can try to achieve your requirements like so:

 

Sample table:

Category SubCategory Value
A a1 1
A a2 2
A a3 3
B b1 4
B b2 5
B b3 6

 

1. Create a table.

Table 2 =
VAR t1 =
    DISTINCT ( 'Table'[SubCategory] )
VAR t2 =
    ADDCOLUMNS ( t1, "Order", RANKX ( t1, [SubCategory],, ASC, DENSE ) + 1 )
VAR t3 =
    DATATABLE ( "Total", STRING, "Order", INTEGER, { { "Total", 1 } } )
RETURN
    UNION ( t3, t2 )

table2.JPG

relationship.JPG

 

2. Create a measure.

Measure = 
VAR a =
    SELECTEDVALUE ( 'Table 2'[Total] )
RETURN
    IF (
        a = "Total",
        CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( ALLEXCEPT ( 'Table', 'Table'[Category] ), 'Table'[SubCategory] = a )
        )
    )

 

3. Create a matrix visual.

matrix visual.JPG

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @henryco88 ,

 

Based on my test, it is not supported in Power BI currently. You can vote this similar idea: Table / Matrix: Total Column on first position.

 

In addition, you can try to achieve your requirements like so:

 

Sample table:

Category SubCategory Value
A a1 1
A a2 2
A a3 3
B b1 4
B b2 5
B b3 6

 

1. Create a table.

Table 2 =
VAR t1 =
    DISTINCT ( 'Table'[SubCategory] )
VAR t2 =
    ADDCOLUMNS ( t1, "Order", RANKX ( t1, [SubCategory],, ASC, DENSE ) + 1 )
VAR t3 =
    DATATABLE ( "Total", STRING, "Order", INTEGER, { { "Total", 1 } } )
RETURN
    UNION ( t3, t2 )

table2.JPG

relationship.JPG

 

2. Create a measure.

Measure = 
VAR a =
    SELECTEDVALUE ( 'Table 2'[Total] )
RETURN
    IF (
        a = "Total",
        CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( ALLEXCEPT ( 'Table', 'Table'[Category] ), 'Table'[SubCategory] = a )
        )
    )

 

3. Create a matrix visual.

matrix visual.JPG

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@henryco88 , I doubt such option for column total

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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