Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
So did already somebody found a solution to the sorting problem that arises when using the new Parameter Field function?
It is really great for switching between Quantity and values but it screws up sorting if you want to sort
it by Quantity or Values showing highest values first.
Solved! Go to Solution.
@v-yadongf-msft well yeah of course I can sort it manually but the whole purpose of using Power BI is to make data handling better, easier to use and visually better than manual work 😁.
Anyway thru several online post I came up with a solution myself for this problem.
First of you need to make an extera column in the parameter field table:
It is a copy of the main column in the table but for some reason you cannot use that one.
(getting error about the composite key etc)
When you have that you kan make a variable Rank Measure like:
And when you switch to USD view:
Works like a charm! 😁
And if you don't want to show the rank measure in your visual you can turn word wrap of in column header and the values and then you can just hide the column by sliding the width all to the left making it so narrow that it will nog show anymore.
For a chart even more easy, you just put it in the tooltips and then you can still sort on it but it won't show in the graph.
Thanks for posting this, I had the same problem with a slight twist, and you helped me most of the way to a solution.
Just quickly to redescribe the problem, I had a chronological graph that I wanted to swap between showing years, months, weeks etc. PowerBI "Parameters" seemed a perfect fit for use-case, but when you click between periods options, it would lose the sorting of the X-axis (only on some types of periods, not others - which I still don't understand), falling back to sorting by Y-axis, leaving you with a graph that made no sense like this:
so, like you said, I added in an extra column in the parameter:
Then, made a new measure that calculated a rank depending on what the parameter setting was. Note that here the calendar is held in the table "DimCalendar" and the data I'm showing in the graph is in the table "All_Cases":
And then I just needed to add that new "RankingPeriod" measure to the tooltips of the chart, and then sort the graph by it (I'm not 100% sure why it only works when sorting DESC, but I'm sure someone smarter will tell me):
and hey-presto, it works as it should:
Thanks again... I'm still quite confused why this fairly simple use-case is so tricky in PowerBI, but hey, who knows.
I think because The Origin Dim Column Sorted By Another Column
Have you found a decision?
There are dax function for it ORDERBY but i am not sure that it is the best solution
How do you mean if I found a decision? I went with the accepted solution above.
Works like a charm
@v-yadongf-msft well yeah of course I can sort it manually but the whole purpose of using Power BI is to make data handling better, easier to use and visually better than manual work 😁.
Anyway thru several online post I came up with a solution myself for this problem.
First of you need to make an extera column in the parameter field table:
It is a copy of the main column in the table but for some reason you cannot use that one.
(getting error about the composite key etc)
When you have that you kan make a variable Rank Measure like:
And when you switch to USD view:
Works like a charm! 😁
And if you don't want to show the rank measure in your visual you can turn word wrap of in column header and the values and then you can just hide the column by sliding the width all to the left making it so narrow that it will nog show anymore.
For a chart even more easy, you just put it in the tooltips and then you can still sort on it but it won't show in the graph.
Hi @rpinxt ,
By default, as shown, the visual doesn't sort the field parameter.
You can sort field parameter manually.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rpinxt ,
The sorting of field parameter is the same as the sorting of common fields, which can be ascending or descending.
What problems are you having with sorting field parameters ? Can you explain it with some screenshots?
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I don't think sorting is the same. Because parameter fields change the visual (which they are intended to do).
Here are some examples :
So here you see the visual is sorted by BO Qty descending.
At the top you see I have a slicer with BO Qty and USD Amt which are parameter fields.
(set up with the new parameter function in Power BI)
Now I switch the view to dollars instead of quantities:
Now you can clearly see that the visual is not sorted anymore by anything.
Probably logical because BO Qty is not in the visual anymore.
I love the new feature with field parameters but this is a big downside still.
The visual should have the variable parameter name in as a sort option not the field name that is currently selected:
Is there a way around?
So make the visual sort on the selected measure?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |