cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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?

1 ACCEPTED SOLUTION
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.

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

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.

Best regards

Icey

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

2 REPLIES 2
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.

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

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.

Best regards

Icey

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

Super User

@henryco88 , I doubt such option for column total

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors