Forum Discussion
Sort by columns by value in Matrix Visual
I have a table contains ID and Week columns as below
| 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.
Here is my question, is it possible to sort by weekly value in DAX or Measure?
Like if I want to sort by Week3, the visual will change to:
| Week1 | Week2 | Week3 | Total | |
| 003 | 1 | 2 | 3 | |
| 001 | 1 | 1 | 2 | |
| 002 | 1 | 1 | ||
Any answer will be helpful! Thanks!!
- Anonymous2 years ago
Hi Anonymous ,
First of all, thanks amitchandak for the quick reply. I have a few other thoughts to add:
(1) My test data is the same as yours.
(2) For example, you want to sort by Week3. We can create measures.
Measure = COUNT('Table'[Week])Measure 2 = var _week="Week3" var _count=MAXX(FILTER(ALL('Table'),[ID] in VALUES('Table'[ID])&&[Week]=_week),[Measure]) return _count(3) Sort by [Measure2] in descending order. Then manually adjust the column width to hide Measure2 and turn off "text wrap".
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandakSuper User
Anonymous , As of now you can not sort on Matrix column file value. You can sort on GT of the column field
- AnonymousNot applicable
amitchandak , Thank you for your reply!
About GT, how to sort on GT? Do I need to use ISINSCOPE function?
An example will be really helpful!
- AnonymousNot applicable
Hi Anonymous ,
First of all, thanks amitchandak for the quick reply. I have a few other thoughts to add:
(1) My test data is the same as yours.
(2) For example, you want to sort by Week3. We can create measures.
Measure = COUNT('Table'[Week])Measure 2 = var _week="Week3" var _count=MAXX(FILTER(ALL('Table'),[ID] in VALUES('Table'[ID])&&[Week]=_week),[Measure]) return _count(3) Sort by [Measure2] in descending order. Then manually adjust the column width to hide Measure2 and turn off "text wrap".
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.