Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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?
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
78 | |
52 | |
38 | |
35 |
User | Count |
---|---|
93 | |
73 | |
55 | |
52 | |
46 |