Forum Discussion

wangjuan303's avatar
wangjuan303
Helper III
4 years ago
Solved

How to create filter table with Varible

I need create filter table, when Dax code like this, table will return right result  :  Filter Table = FILTER( DimProduct, DimProduct[Color]='Red' && DimProduct[SizeUnitMeasureCode...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  wangjuan303 ,

    Calculated tables cannot be affect dinamically by slicers, so you cannot have a dinamic calculted table on the fly to use on a visualization。

    You can use Flag as a marker, put is=1 in the filter, and form the same effect as the calculation table in visual

    Here are the steps you can follow:

    1. Create measure.

    Flag =
    var _selectcolor=SELECTEDVALUE('DimProduct'[Color])
    var _selectsize=SELECTEDVALUE('DimProduct'[SizeUnitMeasureCode])
    return
    IF(
        MAX('DimProduct'[Color])=_selectcolor &&MAX('DimProduct'[SizeUnitMeasureCode])=_selectsize,1,0)

    2. Place [Flag]in Filters, set is=1, apply filter.

     

    Best Regards,

    Liu Yang

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