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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tychi95
New Member

Slicer that checks two columns

Hello.

 

I have a table that has two columns I would like to use a slicer for, Primary Capability and Secondary Capability (there are other columns but they are not related to this slicer).

 

Example table:

Row #Primary CapabilitySecondary Capability
1Account Management 
2Data MigrationAccount Management
3Cyber SecurityAccount Management
4AnalyticsCyber Security
5Insider Risk 

 

I have a Capabilties table which will provide the slicer with its options. If I select 'All' in the slicer, it should display all rows in the table. If I select one option, it should display rows where the Primary or Secondary Capabilities match (Scenario A). If I select multiple options, it should display rows where the Primary or Secondary Capabilities are any one of the selected options (Scenario B).

 

Scenario A:

 

If I select Account Management in the slicer, the following rows should be displayed.

Row #Primary CapabilitySecondary Capability
1Account Management 
2Data MigrationAccount Management
3Cyber SecurityAccount Management

 

Scenario B:

 

If I select Cyber Security and Insider Risk in the slicer, the following rows should be displayed

Row #Primary CapabilitySecondary Capability
3Cyber SecurityAccount Management
4AnalyticsCyber Security
5Insider Risk 

 

Thanks in advance!

1 ACCEPTED SOLUTION
Krutigawale33
Responsive Resident
Responsive Resident

Hello @tychi95 ,

create a new column in your table I used Sheet1 here

PrimaryCapability|SecondaryCapablility = COMBINEVALUES("|",Sheet1[Primary Capability],Sheet1[Secondary Capability])

and then create new table 
Slicer =
DISTINCT (
UNION (
SELECTCOLUMNS (
Sheet1,
"Selection", Sheet1[Primary Capability],
"Capabilities", Sheet1[PrimaryCapability|SecondaryCapablility]
),
SELECTCOLUMNS (
Sheet1,
"Selection", Sheet1[Secondary Capability],
"Capabilities", Sheet1[PrimaryCapability|SecondaryCapablility]
)

)
)

So create a relationship between this two tables

Sheet1 table, PrimaryCapability|SecondaryCapablility column and Slicer table Capabilities column 

and cross filter direction both

and use selection column in slicer to filter the data.

View solution in original post

3 REPLIES 3
Krutigawale33
Responsive Resident
Responsive Resident

Hello @tychi95 

 

You can refer my pbix file here pbix file 

 

Krutigawale33
Responsive Resident
Responsive Resident

Hello @tychi95 ,

create a new column in your table I used Sheet1 here

PrimaryCapability|SecondaryCapablility = COMBINEVALUES("|",Sheet1[Primary Capability],Sheet1[Secondary Capability])

and then create new table 
Slicer =
DISTINCT (
UNION (
SELECTCOLUMNS (
Sheet1,
"Selection", Sheet1[Primary Capability],
"Capabilities", Sheet1[PrimaryCapability|SecondaryCapablility]
),
SELECTCOLUMNS (
Sheet1,
"Selection", Sheet1[Secondary Capability],
"Capabilities", Sheet1[PrimaryCapability|SecondaryCapablility]
)

)
)

So create a relationship between this two tables

Sheet1 table, PrimaryCapability|SecondaryCapablility column and Slicer table Capabilities column 

and cross filter direction both

and use selection column in slicer to filter the data.

mussaenda
Super User
Super User

Hi @tychi95,

 

Is it okay for yo to do a separate table for Primary and secondary Capability?

then create a bridge to connect both of them.

And use that bridge in Slicer.

 

For sure others have different approach on this also.

 

But hope this helps.

Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.