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.
ID | Week |
001 | Week1 |
002 | Week2 |
003 | Week2 |
001 | Week3 |
003 | Week3 |
003 | Week3 |
And I use these 2 to create the Matrix Visual, and the value is Count of ID (I want to calculate how many times that each ID shows in different weeks)
The Matrix Visual is as below:
Week1 | Week2 | Week3 | Total | |
001 | 1 | 1 | 2 | |
002 | 1 | 1 | ||
003 | 1 | 2 | 3 |
Now I can sort by Total column only.
My question is: If I want to sort by Week3, the visual should change to:
Week1 | Week2 | Week3 | Total | |
003 | 1 | 2 | 3 | |
001 | 1 | 1 | 2 | |
002 | 1 | 1 | ||
I already know that it's not possible to sort by value only.
But is there any way that I can get closer to the expected output? Like using ISINSCOPE function maybe?
Any answer will be helpful! Thanks!!
Solved! Go to Solution.
Hello @Anonymous,
This isn't directly supported through standard sorting options, but you can achieve the result by creating a custom measure and using it to sort the matrix.
SortByWeek3 =
CALCULATE(
COUNT('YourTable'[ID]),
FILTER(
'YourTable',
'YourTable'[Week] = "Week3"
)
)
Add this measure to your matrix visual (You can add it as a hidden column if you don't want it to be displayed) and sort by the SortByWeek3 measure.
Hope this helps.
Hello @Anonymous,
This isn't directly supported through standard sorting options, but you can achieve the result by creating a custom measure and using it to sort the matrix.
SortByWeek3 =
CALCULATE(
COUNT('YourTable'[ID]),
FILTER(
'YourTable',
'YourTable'[Week] = "Week3"
)
)
Add this measure to your matrix visual (You can add it as a hidden column if you don't want it to be displayed) and sort by the SortByWeek3 measure.
Hope this helps.
Hi @Anonymous
Unfortunately, this functionality is not available with the core matrix, and I don't believe there are any workarounds to address this.
Please vote on the idea about the issue (I voted):
https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=1513f45d-a47a-4326-adbe-8bb0023da6c8
But I free matrix in the marketplace with the needed sorting functionality :
You need to get with the mouse cursor to the wanted column and give a right click to see the sort "menu".
From here, the first click will sort the column in descending order and, the second ascending.
The pbix with the example is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
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 |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |