Forum Discussion
How to Sort Columns in a Matrix Visual
- Anonymous2 years ago
Hi CJ-Flag ,
If you are trying to sort the columns based on the following total value.
1. first you can create a calculated column to get the total value.Column = CALCULATE ( SUM ( financials[ Sales] ), FILTER ( ALL ( financials ), 'financials'[Month Name] = EARLIER ( 'financials'[Month Name] ) ) )2. Then create a calculation table and create a one-to-many relationship with the original table.
Table = SUMMARIZE('financials','financials'[Month Name],'financials'[Column])3. Make the month name column in the calculation table sorted according to the column column.
4. Place the corresponding fields in the matrix.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
To dynamically sort columns in a Power BI matrix visual by the highest values of a summation, you can follow these steps:
- Create a Measure for Summation:
- First, ensure you have a measure that calculates the summation of the values you want to sort by. Let's call this measure TotalValue.
TotalValue = SUM('YourTable'[YourValueColumn])
- Create a Rank Measure:
- Create a measure to rank the columns based on the summation values.
ColumnRank =
RANKX(
ALLSELECTED('YourColumnTable'[YourColumn]),
[TotalValue],
,
DESC,
DENSE
)
- Add the Rank Measure to the Matrix Visual:
- Drag your columns field to the Columns area of the matrix visual.
- Add the ColumnRank measure to the matrix visual as a value.
- Sort the Columns by the Rank Measure:
- Click on the column header in the matrix visual to sort by ColumnRank.
- This should dynamically sort the columns by the highest values of the summation.