Forum Discussion
Search Value on Multiple Columns and return all associated
Create a new calculated table in Power BI that combines all the salesperson names into a single column. You can use the UNION function to achieve this:
AllSalespersons = UNION(VALUES(Sales[Salesperson 1]), VALUES(Sales[Salesperson 2]), VALUES(Sales[Salesperson 3]))Create a DAX measure to calculate the selected salesperson based on the slicer selection. Let's call this measure "SelectedSalesperson":
SelectedSalesperson = SELECTEDVALUE(AllSalespersons, "")Create another calculated table to filter out the selected salesperson from the "AllSalespersons" table:
OtherSalespersons = FILTER(AllSalespersons, [AllSalespersons] <> [SelectedSalesperson])Finally, use a table visual and display the "OtherSalespersons" calculated table. This table will show the list of names who worked with the selected salesperson but exclude the selected salesperson itself.
When you use the slicer to select a salesperson, the table visual will dynamically update to display the names of other salespersons who worked with the selected person, excluding the selected person.
Remember to set up the slicer to use the "SelectedSalesperson" measure for its value selection. This way, the slicer controls the filtering based on the selected salesperson.
Hi Jorge,
I appreciate your help.
However, I couldn't create the metric SelectedSalesperson once Allsalesperson we created in the first place it's a measure. SELECTEDVALUE has a <column> in its syntax. The same applies to the OtherSalesperson measure where FILTER syntax needs a <table>.
Do you see any alternative to overcome that?
- Anonymous2 years agoNot applicable
FYI - AllSalespersons, The first dax is for creating the table that your are going to need, is not a dax for a measure, is the dax you use when you create a new table.
then you paste the dax