Forum Discussion
Dynamic Categories based on a drop down
- 1 year ago
Anonymous ,
I think this is possible, Try using an IFELSE clause to the column and direct it to use the selected value in the slicer using the SELECTEDVALUE() DAX function whenever there is a filter being done on the slicer. If no slicer selection, then display the SWITCH() output. So roughly the DAX would look like below
ColumnName = IF( AND(HASONEFILTER(Category1), HASSONEFILTER(Category2)), <<Put the selected values here using the SELECTEDVALUE() DAX>>, SWITCH(<<expression>>))If this helps with your question, kindly appreciate with a kudo! If this solves, mark it as solution !!
Regards,
Hi Anonymous ,
I would not try to do this from inside Power BI. Instead have this table where the User is going to change the category in a sharepoint file or Onedrive and read that table into Power BI.
This way user can directly change the category as they want for the item and you don't have to manually change the file everytime.
Of course you need to refresh the Power BI file, once the category is changed by the user, which you can automate using Power Automate flows
It this helps, mark it as a Solution, Appreciate a Kudo !
Regards,
I'm not explaining myself properly. In my table:
| Item |
| A |
| B |
| C |
| D |
I have added a column with a SWITCH statement assigning the different items to different categories. I would like to have two slicers 'Choose items for Category 1' and 'Choose items for Category 2'. Then users can pick which ever items they want in each category and that populates the new column instead of the SWITCH statement. Then this new column is used in the 'Legend' data for my plot. Is this possible?
- Thejeswar1 year ago
Super User
Anonymous ,
I think this is possible, Try using an IFELSE clause to the column and direct it to use the selected value in the slicer using the SELECTEDVALUE() DAX function whenever there is a filter being done on the slicer. If no slicer selection, then display the SWITCH() output. So roughly the DAX would look like below
ColumnName = IF( AND(HASONEFILTER(Category1), HASSONEFILTER(Category2)), <<Put the selected values here using the SELECTEDVALUE() DAX>>, SWITCH(<<expression>>))If this helps with your question, kindly appreciate with a kudo! If this solves, mark it as solution !!
Regards,