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.
Hi Experts
So I am using a field parameter as column and want it to sort dynamically based on distinct count of order ids. For eg, I want the below table to sort dynamically with Standard Class on left as it has highest order ids , followed by Second Class, First Class and then Same Day.
But it should dynamically change order based on order ids when I switch to Category or any other parameter.
I tried to create a dax to countd distinct ids and rankx to rank the dimensions but it is giving circular error.
Any help will be deeply appreciated.
Added a workbook with case scenerio for reference.
Superstore Reference Workbook.pbix
Data Preview -
Hi @anshusaketsingh. Did you find a solution? I have encountered a similar issue and would really appreciate it if you could share how you solved it. Thank you!
Hi @anshusaketsingh ,
The link can’t be opened.
Please try the following methods:
1.Create the simple table.
2.Create the new column to sort desc.
Desc order =
VAR stat = 'Table'[State]
RETURN
RANKX(
FILTER('Table', 'Table'[State] = stat), 'Table'[ID], ,DESC, Skip
)
3.Drag the field into the matrix visual. Select the Class field, and choose sort by column feature and select new column.
4.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot for your response @Anonymous
The solution unfortunately doesn't seem to wirk because the ids are not unique as in your with my workbook.
Also its parameter rather than column that I am using.
Below is how my original data looks like -
Attached the workbook too-
Superstore Reference Workbook.pbix
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 |
---|---|
69 | |
64 | |
51 | |
36 | |
26 |
User | Count |
---|---|
85 | |
55 | |
45 | |
44 | |
36 |