This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Let's say I have table like this:
| Country | C1 | C2 | C3 |
| Product | Sales | Sales | Sales |
| P1 | 10 | 20 | 50 |
| P2 | 30 | 10 | 60 |
| P3 | 50 | 0 | 10 |
Product is the rows in the matrix, Country is in the columns and Sales is the measure in the values.
I want to sort let's say sort by Sales ascending in country C2, so I would get something like this:
| Country | C1 | C2 | C3 |
| Product | Sales | Sales | Sales |
| P3 | 50 | 0 | 10 |
| P2 | 30 | 10 | 60 |
| P1 | 10 | 20 | 50 |
I want to do it by specific column like this.
Solved! Go to Solution.
Yes, change the column total to only include C2.
Measure = if(ISINSCOPE('Table'[Country]),sum('Table'[Sales]),CALCULATE(sum('Table'[Sales]),'Table'[Country]="C2"))
Sort by the column total.
Hide the column total.
I want to have the option to change by any country whenever I want instead of keeping static just for C2. So, if I want to do by C1 and C3, then end user should be able to do that.
To add, I don't want to create a measure where I remove the columns from matrix and explicitly add the country in the measure for example CALCULATE([Sales], Country = "C2") and so on. This is a solution but not something I am looking for since I prefer having to keep the columns.
Sure, have a disconnected slicer for the country selection and in the measure read the current slicer value.
The measure is no longer able to read slicer value using SELECTEDVALUE if it is disconnected.
please elaborate?
How did you change the column total to only include C2? I do not get that point.
What I tried to do was create a new measure just for sorting. This measure would calculate the value based on the value in the slicer and not the column value coming from the matrix. However, for this I had to disconnect the matrix from the slicer but when I did this, the new measure created for sorting no longer works since disconnection led to me not being able to read the value of the slicer using SELECTEDVALUE.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 3 | |
| 3 | |
| 2 |