Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, I created a field parameter and on the left side are the 6 fields that I've set up. On my right side is a filter ("Choose Track(s)").
I want that when the user clicks on each button, the description changes to "Choose Album(s)", "Choose Artist", etc.
I can create a measure that does that but I can't seem to create a way that changes the slicer to use the field as specified, when the user clicks a button
I used a switch dax measure but that didn't help. Here's my code
Solved! Go to Solution.
Hi @StevenT
If you're meaning to change the slicer header, you can conditionally format it using a measure that responds to the selected value of the Parameter Order column.
Slicer Title =
SWITCH ( SELECTEDVALUE ( Parameter[Parameter Order] ), 0, "Text", 1, "Text2" )
Hi @StevenT ,
Do you want to select column names in Slicer1 and show values of selected column in Slicer2?
If so, please refer to the method in message 3, that may be what you want.
Best regards,
Mengmeng Li
Hi @StevenT ,
What do you want to do with the data source? If you want to use parameter to dynamically change data sources in visuals, you can refer to my reply in this post. Solved: Dynamic API call - Microsoft Fabric Community
Best regards,
Mengmeng Li
Thanks for this. I have been able to change the title with no difficulty, it's what I want to do with the data source, that I've run into a challenge.
Any ideas about the data source?
Hi @StevenT ,
I'm afraid you'll need to create a custom table for dynamic slicer, because in Power BI, slicers are typically used to filter data, and they're mostly used with column fields, not measures. The measure is the result of a dynamic calculation and cannot be used directly as a field in the slicer.
1. Use Union to combine all the columns in the parameter and their corresponding order into a new table.
Table 2 = DISTINCT(UNION(ADDCOLUMNS(SELECTCOLUMNS('Album',"Field",'Album'[Album]),"Order",0),ADDCOLUMNS(SELECTCOLUMNS('Artist',"Field",'Artist'[Artist]),"Order",1)))
//Add other fields as Album and Artist.
2. Add "one to many" relationship between parameter and custom table.
3. Use "Field" column in dynamic slicer. Then the slicer will show selected column values when you select parameter slicer.
4. If you want dynamic slicer to filter origianl tables, you can create relationships between them.
5. For the changed title of dynamic slicer.
Measure = SWITCH(SELECTEDVALUE(Parameter[Parameter Order]),0,"Choose Album",1,"Choose Artist")
Here is my test and attached pbix file for your reference. I am showing value of Table[Date] and Table(2)[Test1] in dynamic slicer.
Best regards,
Mengmeng Li
Hi @StevenT
If you're meaning to change the slicer header, you can conditionally format it using a measure that responds to the selected value of the Parameter Order column.
Slicer Title =
SWITCH ( SELECTEDVALUE ( Parameter[Parameter Order] ), 0, "Text", 1, "Text2" )
Actually I found a way to do it that didn't require much coding. Please take a look at this link and tell me what you think? It worked perfectly for me.
https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Power-BI-Power-BI-Create-Dynamic-Sl...
You lost me there. Weren't you already usnig field parameters as you said you created one and you just wanted the title/header in the second slicer to be dynamic?
Creating the title was easy. The challenge I was having is that I wanted to take slicer one, let the user change the slicer values, and whatever is changed in slicer one, changes the values in slicer two.
Hi @StevenT ,
Do you want to select column names in Slicer1 and show values of selected column in Slicer2?
If so, please refer to the method in message 3, that may be what you want.
Best regards,
Mengmeng Li
User | Count |
---|---|
77 | |
76 | |
44 | |
30 | |
26 |
User | Count |
---|---|
97 | |
91 | |
52 | |
47 | |
46 |