Forum Discussion
How to create filter table with Varible
- Anonymous4 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
wangjuan303 , You can not create a calculated table using slicer values, You can create it only as var in a measure
Measure =
Var Color = SELECTEDVALUE ('Color'[Color])
Var Code = SELECTEDVALUE ('Code'[Code])
var _tab =
FILTER(
DimProduct,
DimProduct[Color]=Color
&&
DimProduct[SizeUnitMeasureCode]=Code)
return
<Code>
I just tried this code, still show blank, when I change hardcode, will show the result, so still some part not right, Thank you