Forum Discussion
Toggle data values in a slicer
- 1 year ago
Hi DioLago79
The most direct method to switch the column used on a slicer would be to create a field parameter containing the two possible columns, along with a slicer to select the field parameter value itself.
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
Depending on the model and the nature of the visuals, you could also use a calculation group approach:
https://www.sqlbi.com/articles/using-calculation-groups-to-switch-between-dates/
With this approach, the slicer would use a column from the date table, say
'Date'[Date], but changing the calculation item selection would change the relationship applied when evaluating measures.Would either of these methods work for you?
Hi DioLago79,
As per my understanding, slicer can't switch between two columns. I tried some workaround to implement the same logic by using DAX.
Please find the attached pbix file with sample data and DAX expressions to achieve the same.
Toggle data values in a slicer.pbix
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated — thanks!
Best Regards,
Maruthi