The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
Solved! Go to Solution.
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:
Now, when Geo is filtered, the axis changes to Country, otherwise stays as Geo.
Does something like this work for you?
Regards
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:
Now, when Geo is filtered, the axis changes to Country, otherwise stays as Geo.
Does something like this work for you?
Regards
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |