Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Slice Table by Data in Multiple Columns

Hi everyone.  I was looking through similar posts but could not find a question seemingly the same.

 

I have a source table with rows defined for each "task" and then 3 columns indicating the person assigned to each position of the task (see example table).  As one person may be assigned to a different position, given the task, I am looking for a way to create a slicer by "person" that would allow to filter for all tasks assigned to that person, regardless of position.

TaskPosition 1Position 2Position 3
1AlexBritneyCharles
2BritneyCharlesDarla
3CharlesDarlaEric
4AlexCharlesDarla
5FrankBritneyHelen
6GaryEricFrank

 

I HAVE had success "unpivoting" the position columns in the power queary, essentailly making 6 rows into 18, and then rebuilding the "Position" columns with DAX

 

Gorlinjer_0-1710361148340.png

 

Then, I rebuilt the table visual using the "last" values for each position:

 

Gorlinjer_1-1710361268492.png

Finally, I added a slicer for the created "Values" column (each person), and it WORKS!!!... however, the slicer then also removes the other assigned people to that task (which is definitely as expected).

 

Gorlinjer_2-1710361353678.png

 

My end goal is to create that table/slicer from the original data, but when a person is selected, I need to be able to see the other people assigned to that task.  I hope this makes sense!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try this way.
I add a new table to create the slicer:

vjunyantmsft_0-1710383104296.png

There is no relationship between two tables:

vjunyantmsft_1-1710383135105.png


Use this DAX to create a measure:

Measure = 
VAR _P = ALLSELECTED('Slicer'[Name])
RETURN
IF(
    ISFILTERED('Slicer'[Name]),
    IF(
        COUNTROWS(
            FILTER(
                _P,
                [Name] IN VALUES('Table'[Position 1]) ||
                [Name] IN VALUES('Table'[Position 2]) ||
                [Name] IN VALUES('Table'[Position 3])
            )
        ) > 0,
        1,
        0
    ),
    1
)

Set the settings according to the following screenshot:

vjunyantmsft_2-1710383231757.png

vjunyantmsft_3-1710383266297.png

The final output is as below:

vjunyantmsft_4-1710383298633.png

vjunyantmsft_5-1710383308880.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello!  Me again!

 

So, this fix has helped in getting the table to do as desired (slice by a name, and all relevant rows remain).  

 

However, I need help knowing if I can carry this "slice/filter" across all other visuals.  For example with the sample data provided, if I wanted to add a card for counting total tasks, and then tasks assigned.  (ie. would display "6" when unfiltered, but when Britney is selected, the card would display "3").

 

I tried applying the same method of including that measure as a filter on the "card" but it does not let me change the settings to "is 1".

 

I hope this makes sense.  Thank you.

Anonymous
Not applicable

Thank you!  This worked perfectly!

Anonymous
Not applicable

Hi @Anonymous ,

Please try this way.
I add a new table to create the slicer:

vjunyantmsft_0-1710383104296.png

There is no relationship between two tables:

vjunyantmsft_1-1710383135105.png


Use this DAX to create a measure:

Measure = 
VAR _P = ALLSELECTED('Slicer'[Name])
RETURN
IF(
    ISFILTERED('Slicer'[Name]),
    IF(
        COUNTROWS(
            FILTER(
                _P,
                [Name] IN VALUES('Table'[Position 1]) ||
                [Name] IN VALUES('Table'[Position 2]) ||
                [Name] IN VALUES('Table'[Position 3])
            )
        ) > 0,
        1,
        0
    ),
    1
)

Set the settings according to the following screenshot:

vjunyantmsft_2-1710383231757.png

vjunyantmsft_3-1710383266297.png

The final output is as below:

vjunyantmsft_4-1710383298633.png

vjunyantmsft_5-1710383308880.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.