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
It is not clear from your post how your tables are structured. E.g. Your calendar table description makes sense but then the fields table description seems to use some different design, and it is not clear what columns it has. You haven't provided I formation about how your tables are joined, if at all. Without this information it is impossible to give a formula that will work.
It is not clear if you actually need this column - power bi is designed to allow table to work together without the need to consolidate columns.
- mpeters19888 years agoFrequent Visitor
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?
- v-ljerr-msft8 years agoMicrosoft Employee
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