Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
good, I have this matrix and the subtotal column is the latter, I need it first
Solved! Go to Solution.
Hi, @Syndicate_Admin
According to your description, you want to put the sub_total as first.
Total in the default Matrix is automatically generated and currently has no settings to place in the first column.
For your need , you can create a dimension column table in Power Query .
Here are the steps you can refer to :
(1)This is my test data:
We can create a "Blank Query" in Power Query and enter this M code to create a dimension column table:
let
Source = {"Total"} &List.Distinct(Table[Column]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Index", 1, 1, Int64.Type)
in
#"Added Index"
(2)Then we can load the data to Power BI Desktop , then we can create a measure :
Measure = var _cur_column = MAX('Table 2'[Column1])
return
IF( _cur_column = "Total" , CALCULATE( SUM('Table'[Value]) ) ,
CALCULATE(SUM('Table'[Value]) , 'Table'[Column] =_cur_column) )
(3)Then we can put the fields we need on the visual and we can sort the 'Table 2 '[Column1] by the 'Table 2'[Index] column and now we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
THANK YOU!!
Hi, @Syndicate_Admin
According to your description, you want to put the sub_total as first.
Total in the default Matrix is automatically generated and currently has no settings to place in the first column.
For your need , you can create a dimension column table in Power Query .
Here are the steps you can refer to :
(1)This is my test data:
We can create a "Blank Query" in Power Query and enter this M code to create a dimension column table:
let
Source = {"Total"} &List.Distinct(Table[Column]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Index", 1, 1, Int64.Type)
in
#"Added Index"
(2)Then we can load the data to Power BI Desktop , then we can create a measure :
Measure = var _cur_column = MAX('Table 2'[Column1])
return
IF( _cur_column = "Total" , CALCULATE( SUM('Table'[Value]) ) ,
CALCULATE(SUM('Table'[Value]) , 'Table'[Column] =_cur_column) )
(3)Then we can put the fields we need on the visual and we can sort the 'Table 2 '[Column1] by the 'Table 2'[Index] column and now we can meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
up
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 43 |