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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
powerbiuser6
Frequent Visitor

How do I use descriptive labels in my Power BI slicer without breaking the dynamic query?

I have a database connected via direct query with a table that has a resolution column with values '1' or '2', where 1 represents a low resolution and 2 represents a high resolution of the data. In my Power BI dashboard, I currently have a perfectly working dynamic query with an interactive slicer using these numeric values: I created a parameter called ResolutionParameter of type decimal number and have a list of values with '1' or '2'. This parameter is referenced in the M query. I also created a new table named ResolutionTable with the values '1' and '2'. This resolution field is bound to the ResolutionParameter and used in a slicer on my report page. When someone clicks on '1', the data is filtered with the correct selection.

 

The problem is that '1' and '2' are not very logical or understandable values in a slicer for a user. I would prefer to use the text labels 'low' and 'high'. When I added these values to my ResolutionTable like this ...:

 

resolution   resolution_label

1                  low

2                  high

 

... and then used the values 'low' and 'high' in my slicer, the dynamic query stopped working.

 

How do I ensure that I can use a replacement value in my slicer different from the value I reference in the M query? How can I make my slicer more user-friendly without breaking the underlying query functionality?

3 REPLIES 3
powerbiuser6
Frequent Visitor

Hey, thank you for your answer. Unfortunately I'm not allowed to install any third-party software on my work laptop. Do you think the solution you suggested would also work without using Tabular Editor? I can't seem to find the Group By Columns option

It might be possible using the new preview feature TMDL View. As this feature is still in preview it would be wise to create a copy of the PBIX file first in case anything goes wrong.

Create a script tab for the ResolutionParameter table and under the resolution_label column add

relatedColumnDetails
	groupByColumn: 'resolution'

I believe that the indentation level matters so make sure you start the "relatedColumnDetails" on the same  level as the line above it.

johnt75
Super User
Super User

I'm not 100% sure that this will work in your use case, but I have used this method in different scenarios.

Manually edit the DAX generated for your parameter table to add a new column to each row with the resolution label for that value.

If your parameter table is using GENERATESERIES then replace it with 

Parameter table =
SELECTCOLUMNS (
    { ( 1, "low" ), ( 2, "high" ) },
    "resolution", [Value1],
    "resolution_label", [Value2]
)

Open Tabular Editor and select the resolution_label and in the Options section select Group By Columns. Add the resolution column as the group by column, and save your changes.

In the slicer, when you use the resolution_label column the underlying DAX will, I think, actually use the resolution column, which should then pass the numeric value to your query.

I know this works for regular DAX queries, just not sure if it will work in DirectQuery.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors