Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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!!
Solved! Go to Solution.
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.
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.
@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!