Forum Discussion

na12063's avatar
na12063
Resolver I
7 years ago
Solved

Help Needed!!! Selected Value not filtering??

I have a table with options where I make selection based on our request and supplier promise date and two columns that provides me with the data of it based on the selection.  I'm trying to create hi...
  • v-juanli-msft's avatar
    v-juanli-msft
    7 years ago

    Hi na12063

    Why selected value not filtering in your original table is that calculated columns can't change with slicer.

    I make some transform for your dataset, please see details in my pbix.

    1. in Edit queries

    select two columns and select unpivot columns, then close&&apply

     

    2. in the data view

    create a calculated column

    Column = 
    IF([Attribute]="Supp_Prom_Date",
    Switch ( 
        TRUE(),
    OrderTable[Value]<= -5,   "a.<=-5", 
    OrderTable[Value] = -4,   "b.-4",   
    OrderTable[Value] = -3,   "c.-3",   
    OrderTable[Value] = -2,   "d.-2",   
    OrderTable[Value] = -1,   "e.-1",   
    OrderTable[Value] =  0,   "f.0",    
    OrderTable[Value] =  1,   "g.1",    
    OrderTable[Value] =  2,   "h.2",    
    OrderTable[Value] =  3,   "i.3",    
    OrderTable[Value] =  4,   "j.4",    
    OrderTable[Value]>=  5,   "k.>=5"   
    )
    ,
    SWITCH(TRUE(),
      OrderTable[Value]<= -5,   "a.<=-5", 
    OrderTable[Value] = -4,   "b.-4",   
    OrderTable[Value] = -3,   "c.-3",   
    OrderTable[Value] = -2,   "d.-2",   
    OrderTable[Value] = -1,   "e.-1",   
    OrderTable[Value] =  0,   "f.0",    
    OrderTable[Value] =  1,   "g.1",    
    OrderTable[Value] =  2,   "h.2",    
    OrderTable[Value] =  3,   "i.3",    
    OrderTable[Value] =  4,   "j.4",    
    OrderTable[Value]>=  5,   "k.>=5"   
    )
    )

     

    3. create measures

    Measure = SELECTEDVALUE(DataType[OTDDataType])
    
    Measure 3 = SWITCH(MAX([OTDDataType]),"Our request Date","Our_Req_Date","Supplier Promise Date","Supp_Prom_Date")
    
    Measure 2 = IF([Measure 3]=MAX([Attribute]),1,0)

     

    4 add [column] in the X-axis, [Attribute] in the Legend, [Index column] in the Value field, add Measure2 in the Visual level filter of the column chart and apply when value is 1 show items

     

    Below is my pbix

     

    Best Regards

    Maggie