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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JackWren
Helper II
Helper II

Dynamic sorting column in Field Parameter

Hi, 

 

I am currently building a report that contains two field parameters. 

The one on the left is to toggle between "Country and Product" : 

Parameter = {
    ("Country", NAMEOF('Country'[Country]), 0),
    ("Product", NAMEOF('Product'[Product]), 1)
}

 

And the other one is a different one that is used in the matrix as a drill down : 

[Parameter 2 ] = {
    ("Country", NAMEOF('Country'[Country]), 1),
    ("Product", NAMEOF('Product'[Product]), 2),
    ("Segment",NAMEOF(financials[Segment]),3)
}

 

I wanted to know if it is possible to dynamically change the sort order of the columns in the field parameter 2 based on the selection in the field parameter 1. 

 

That is to say if we select country, we see this drill down : 

- Country 

- Product

- Segment

 

If we select Product, we have this hierarchy instead : 

- Product

- Country

- Segment

 

I don't think it is directly possible as these are tables but maybe somebody has found a workaround there ? 

Parameter example.PNG

Thank you 

 

Kind regards,

 

 

1 ACCEPTED SOLUTION

Haha, we were on the same track. I tried to also create a relationship between the two tables but I added a key column to link them instead of linking them on the order column. This seems to work in the dummy file but not in my model so I have to compare the two. 

 

[Parameter 2 ] = {
    ("Country", NAMEOF('Country'[Country]), 1,0),
    ("Product", NAMEOF('Product'[Product]), 2,0),
    ("Segment",NAMEOF(financials[Segment]),3,0),
    ("Country ", NAMEOF('Country'[Country]),6,1),
    ("Product  ", NAMEOF('Product'[Product]), 5,1),
    ("Segment ",NAMEOF(financials[Segment]),4,1)
}

View solution in original post

5 REPLIES 5
SamWiseOwl
Super User
Super User

I feel like the answer is sort of:

SamWiseOwl_0-1722958479419.png

It need refining but what I did was join the Top Slicer field to the Field Slicer

SamWiseOwl_1-1722958552726.png

 

In the field slicer I dragged each field in twice

SamWiseOwl_2-1722958576774.png

 

 

I'm sure there is a more elegant way!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Haha, we were on the same track. I tried to also create a relationship between the two tables but I added a key column to link them instead of linking them on the order column. This seems to work in the dummy file but not in my model so I have to compare the two. 

 

[Parameter 2 ] = {
    ("Country", NAMEOF('Country'[Country]), 1,0),
    ("Product", NAMEOF('Product'[Product]), 2,0),
    ("Segment",NAMEOF(financials[Segment]),3,0),
    ("Country ", NAMEOF('Country'[Country]),6,1),
    ("Product  ", NAMEOF('Product'[Product]), 5,1),
    ("Segment ",NAMEOF(financials[Segment]),4,1)
}

Great minds, sadly I was teaching so couldn't respond faster!

I found when. I created a new column assigning the values it crashed when the data was refreshed.

Hence the method of using the name to do the join instead.

 

Cheers for the Kudos 😁


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Super User
Super User

Hi @JackWren 

 

Not exactly an answer but checking if you knew:
If you put [Parameter 2 ]  in a slicer and set it to multi select, the order in which your user ticks then will define the nesting order they appear in the visual.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Yes, I know I had this at first but the end users do not want to have to select their own columns. 

And I'm trying to avoid using bookmarks. 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.