Forum Discussion

harirao's avatar
harirao
Post Prodigy
5 years ago

DAX for Slicer using source Column

Hello All,

 

Required your assistance, i have a column from table called file flag, by using this i have created slicer call metrics.
File Flag
DTFC
CTS
S4 
OTD

Metric (Slicer)
DTFC combination of DTFC & S4 
OTD combination of CTS & S4
OTD only OTD

Column

Metrics = SWITCH(tbl_dep3_big_deal_perf_data_final_main[file_flag],"DTFC","DTFC", "S4", "DTFC","CTS","CTS", "S4", "CTS" ,"OTD")

I used above function to create slicer, DTFC & OTD is working correctly, for CTS its taking on CTS not taking S4

DTFC selection (DTFC & S4)


CTS both has to be selected from FileFlag (CTS & S4)

Only OTD from File flag



Thanks for your help

Regards,

4 Replies

  • tex628's avatar
    tex628
    Community Champion

    For this to work you need to get an additional row in your slicer table. The switch just replaces values and does not add new rows, this means that since the "S4" -> "DTFC" occurs before the "S4" -> "CTS" all references to "S4" will be converted to "DTFC". 

    How does your metrix table currently look? 

    / J

    • harirao's avatar
      harirao
      Post Prodigy

      Hi tex628 

      Please find the below screen print for your reference, i am showing only 15 columns in this matrix table and few slicers on top.

       

      • tex628's avatar
        tex628
        Community Champion

        Sorry, my bad, I meant the Metrics table 🙂

         /J