Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
rpinxt
Impactful Individual
Impactful Individual

Field Parameters sort order

First of Field Parameters are great....but there is a really anoying downside when switching between fields.

The sorting breaking.....

I see alredy complaints about that from a year ago, but has it been solved by now? Or are there good solution?

 

I have a graph that has country on the x-axis and on the y-axis I have a field parameter.

2 option, #deliveries and Quantity.

Works perfect but I want my graph to sort always with the highest number of deliveries (#deliveries) or highest quantity.

But every time you switch the sorting breaks and it will be sorted by Country on the x-axis.

 

This makes no sense as you want the highest numbers to show first and not country alphabetical.

1 ACCEPTED SOLUTION
rpinxt
Impactful Individual
Impactful Individual

Oh my I had an epiphany 😆

I manged to create a sort measure:

rpinxt_0-1681385051970.png

rpinxt_1-1681385065092.png

As you see the heading for this field stays the same and this way the sorting gets not broken.

But the SortValue field takes the value of the field parameter.

 

Did this with an IF statement on the prm sort order :

SortValue = IF(
    SELECTEDVALUE(prm_Measure[prm_Measure Order]) = 0,
    [#Deliveries],
    [LastQty]
)
 
So I only had 2 options, 0 and 1.
Linked both options to their corresponding base measure (like you also do in the parameter).
Now the SortValue field has always the same value as the parameter field but the heading stays the same and thus the sorting setting will not be broken 😄
 
Ah yes you can put this field in a graph with the tooltips.
Won't do anything but it wil show up as an option to sort on! 😉

 

View solution in original post

3 REPLIES 3
datamomgit
Frequent Visitor

This solution really helped us!  Thanks!

rpinxt
Impactful Individual
Impactful Individual

Oh my I had an epiphany 😆

I manged to create a sort measure:

rpinxt_0-1681385051970.png

rpinxt_1-1681385065092.png

As you see the heading for this field stays the same and this way the sorting gets not broken.

But the SortValue field takes the value of the field parameter.

 

Did this with an IF statement on the prm sort order :

SortValue = IF(
    SELECTEDVALUE(prm_Measure[prm_Measure Order]) = 0,
    [#Deliveries],
    [LastQty]
)
 
So I only had 2 options, 0 and 1.
Linked both options to their corresponding base measure (like you also do in the parameter).
Now the SortValue field has always the same value as the parameter field but the heading stays the same and thus the sorting setting will not be broken 😄
 
Ah yes you can put this field in a graph with the tooltips.
Won't do anything but it wil show up as an option to sort on! 😉

 

Mo_
Frequent Visitor

@rpinxt Great idea to solve this issue. There is another way I saw in a youtube video by Christine Payton where she uses bookmarks to get the right sorting order. I found this very creative, but your solution is more fitting for my use case.

 

Thank you!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.