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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
EDWNW
Frequent Visitor

Use a Slicer to Select a Field Parameter

I have a chart along the X-axis with Geos (North America, APAC, UKI...). I also have a filter so users can select a specific Geo. When a user selects a Geo (read when the Geo column is ISFILTERED), I want the X-axis to display the Countries with the selected Geos (for example, if a user selects North America, they would see Mexico, the United States, and Canada). 

To this end, I created a Field Parameter, which includes Geos and Countries. 

Of course, I could leave the user with two slicers, one for the Geos and one for the Field Parameter, and hope they figure out how to work the two together to get the desired result, but we all know this will not work.

Now, I thought I could write a measure using something like

SWITCH(
     TRUE(),
     ISFILTERED(Geo),Field Parameter Country,
    Field Parameter Geo)
but you cannot use a measure for the x-axis (if you can, please let me know).

Does anyone know how I can get a Field Parameter to filter based on whether another slicer is filtered?

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @EDWNW 

Yes, you can control which field parameter item is selected based on a condition such as a particular column being filtered.

 

Small PBIX example attached.

 

The most convenient way I'm aware of to set this up is:

 

1. Create a Flag measure that is evaluated per field parameter value, and returns 1 only if that field parameter value should be used on the visual. In my sample file:

 

Field Parameter Selection Flag = 
VAR CurrentGeographyField =
    MAX ( 'Geography Field Parameter'[Geography] )
RETURN
    INT (
        IF (
            ISFILTERED ( Geography[Geo] ),
            CurrentGeographyField = "Country",
            CurrentGeographyField = "Geo"
        )
    )

 

2. Place the field parameter column on the axis of the visual.

3. Add a visual-level Top N filter on the field parameter column, set to "Top 1 of the field parameter" by the above flag measure:

OwenAuger_0-1720755805553.png

Now, when Geo is filtered, the axis changes to Country, otherwise stays as Geo.

 

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @EDWNW 

Yes, you can control which field parameter item is selected based on a condition such as a particular column being filtered.

 

Small PBIX example attached.

 

The most convenient way I'm aware of to set this up is:

 

1. Create a Flag measure that is evaluated per field parameter value, and returns 1 only if that field parameter value should be used on the visual. In my sample file:

 

Field Parameter Selection Flag = 
VAR CurrentGeographyField =
    MAX ( 'Geography Field Parameter'[Geography] )
RETURN
    INT (
        IF (
            ISFILTERED ( Geography[Geo] ),
            CurrentGeographyField = "Country",
            CurrentGeographyField = "Geo"
        )
    )

 

2. Place the field parameter column on the axis of the visual.

3. Add a visual-level Top N filter on the field parameter column, set to "Top 1 of the field parameter" by the above flag measure:

OwenAuger_0-1720755805553.png

Now, when Geo is filtered, the axis changes to Country, otherwise stays as Geo.

 

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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