Forum Discussion
Measures Filters
Hello,
I created a table in PBI as shown below. I created all flag fields by writing measures such as
Price Flag = IF([Price]>=CALCULATE([Price], ALLSELECTED(Table[SKU]), "Avg or Above", "Below Avg")
3 Replies
- AnonymousNot applicable
HI jayjani,
Measure formulas are calculated expressions that calculated based on current row contents and categories, it was not to use as the category to expand other fields. (slicer require static fields that measure formula not suitable for its requirement).
Currently, you can only use measure on 'visual level filter' to filter records.
If you want to direct choose measure results on the slicer, you need to create a table with measure formula results and coding measure filters based on its selection.New tables:
FlagPrice = SELECTCOLUMNS ( { "Above Avg", "Below Avg" }, "Flag", [Value] ) FlagDisc = FlagPrice FlagMargin = FlagPriceMeasure filters use on the visual level filter to choose 1 result:
PriceFilter= IF([Price Flag] in allselected(FlagPrice[Flag]),1,blank()) DiscFilter= IF([Price Flag] in allselected(FlagDisc[Flag]),1,blank()) MarginFilter= IF([Price Flag] in allselected(FlagMargin[Flag]),1,blank())Regards,
Xiaoxin Sheng
- Greg_Deckler
Community Champion
Wait, why can't you use a measure as a filter? Because I do that all the time. For example:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Inverse-Selector/m-p/648290#M325
- jayjani
Helper I
In that example, you have a Products column which is used as a filter. What if I don't have any columns in my fact table. All are calculated measures and I want them as filter.