Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
7 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |