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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
powerbiuser6
Regular 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?

2 REPLIES 2
powerbiuser6
Regular 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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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