Forum Discussion
Calculated Field for Slicer
- 8 years ago
Hi mpeters1988,
The reason I'm trying to do this is to dynamically fill a single slicer so a user doesn't need dozens of slicers on one page, but only two: one to select the field to filter, one to do the actual filtering/slicing.
In your scenario, you should be able to use the Unpivot option in Query Editor to unpivot those columns(the value type has tp be the same) that you want to use as Slicers.
After unpivoting, you'll get a Attribute column(Field names), Value column(Values). Then you can use only these two columns as Slicers on the report. For more details about how to use the Unpivot option in Power BI, you can refer to this article. :smileyhappy:
Regards
MattAllington: I've edited my post with an example report I made in Power BI, so I hope that sheds some light on what I'm trying to do!
All I'm trying to do is to fill a slicer dynamically based on user selections.
v-ljerr-msft: So if I understand correctly the only way to do this would be a measure and from what I understand, a measure can only return a single value and there's no way a measure or a calculated column can be evaluated so it can dynamically show a different field in the slicer, even though it is possible to construct the name of that field?
Hi mpeters1988,
The reason I'm trying to do this is to dynamically fill a single slicer so a user doesn't need dozens of slicers on one page, but only two: one to select the field to filter, one to do the actual filtering/slicing.
In your scenario, you should be able to use the Unpivot option in Query Editor to unpivot those columns(the value type has tp be the same) that you want to use as Slicers.
After unpivoting, you'll get a Attribute column(Field names), Value column(Values). Then you can use only these two columns as Slicers on the report. For more details about how to use the Unpivot option in Power BI, you can refer to this article. :smileyhappy:
Regards