Forum Discussion

SantoshKumar's avatar
SantoshKumar
Microsoft Employee
3 years ago
Solved

Created two slicers using three column values

Hi All,
I have below three columns in my table and i have two create two slicers as per below requirement.
1. Slicer one value will have values from ColumnA

2. Slicer two will have values from ColumnB and ColumnC

but when i select values from Slicer1 it should show only some values as mentioned below.
a) when i select value as "Super" -> it should display values in Slicer2 only "CU,MN,FE"
b) when i select value as "Big" -> it should display values in Slicer2 only "ZN,TE,KL"
c) when i select value as "Work" -> it should display values in Slicer2 only "all ColumnC values" 

Note: CoulmA and ColumnB are calculated columns.

ColumnAColumnBColumnC
SuperCU2021.07 D
BigMN2021.08 A
WorkFE2021.08 B
 Zn2021.08 C
 TE2021.08 D
 KL2021.09 B
  2021.09 C
  2021.10 B
  2021.10 C
  2022.11 B
  2022.11 C
  2022.12 B
  2022.01 B
  2022.01 C

 

Regards

Santosh 

  • Due to Data integrity, i am providing the result with sample values as mentioned in my post.

     

    Code sample here:
    Slicer1 =
    IF(CONTAINSSTRING(Table1[columnxyz],"ABC")
    || CONTAINSSTRING(Table1[columnxyz],"DEF"),"Super",
    IF(CONTAINSSTRING(Table1[columnxyz],"12AA"),"Big",
    IF(CONTAINSSTRING(Table1[columnxyz],"34BB"),"Work","")))

     

    Slicer2 =
    Switch(True(),
    CONTAINSSTRING(Table1[columnxyz],"ABC")
    || CONTAINSSTRING(Table1[columnxyz],"DEF"),Table1[ColumnB],
    CONTAINSSTRING(Table1[columnxyz],"12AA"),Table1[ColumnB],
    CONTAINSSTRING(Table1[columnxyz],"34BB"),Table1[ColumnC])

7 Replies

    • SantoshKumar's avatar
      SantoshKumar
      Microsoft Employee

      Mahesh0016 Here are the examle:
      Option1 is first selection , Option2 is second selection and Option3 is third selection. Let me know whether it will works?

       

       

      • Mahesh0016's avatar
        Mahesh0016
        Super User

        these are three column in one table or different table.

  • SantoshKumar's avatar
    SantoshKumar
    Microsoft Employee

    Due to Data integrity, i am providing the result with sample values as mentioned in my post.

     

    Code sample here:
    Slicer1 =
    IF(CONTAINSSTRING(Table1[columnxyz],"ABC")
    || CONTAINSSTRING(Table1[columnxyz],"DEF"),"Super",
    IF(CONTAINSSTRING(Table1[columnxyz],"12AA"),"Big",
    IF(CONTAINSSTRING(Table1[columnxyz],"34BB"),"Work","")))

     

    Slicer2 =
    Switch(True(),
    CONTAINSSTRING(Table1[columnxyz],"ABC")
    || CONTAINSSTRING(Table1[columnxyz],"DEF"),Table1[ColumnB],
    CONTAINSSTRING(Table1[columnxyz],"12AA"),Table1[ColumnB],
    CONTAINSSTRING(Table1[columnxyz],"34BB"),Table1[ColumnC])