最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

powerbi - Filtering data in SSAS based on "AND", not "OR" - Stack Overflow

programmeradmin1浏览0评论

In SSAS I have this simple scheme with a list of partners with their tags and the directory of tags. With this scheme, filtering by tags works on the principle "OR" - one of the tags selected by user in the directory can be present for a partner - the partner will be selected.

And how to do this: all selected tags (principle "AND") from the directory of tags must be present for a partner in the partner table and only in this case the partner will be selected.

In SSAS I have this simple scheme with a list of partners with their tags and the directory of tags. With this scheme, filtering by tags works on the principle "OR" - one of the tags selected by user in the directory can be present for a partner - the partner will be selected.

And how to do this: all selected tags (principle "AND") from the directory of tags must be present for a partner in the partner table and only in this case the partner will be selected.

Share Improve this question asked Mar 28 at 11:20 Дмитрий МыльчДмитрий Мыльч 293 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Create a measure similar to this one:

FlagSlicerAND = 
  var slicerCount = IF(ISFILTERED(Tags[Tag]), COUNTROWS(ALLSELECTED('Tags')), 0)
  var partnerTagCount = DISTINCTCOUNT(Partners[TagId])

  return IF(slicerCount = 0 || slicerCount = partnerTagCount, 1, BLANK())

You can then either add this measure as a Visual Filter and set it to is not blank, and/or use it in your other measures within, eg:

Total Partners = 
  SUMX(
    DISTINCT(Partners[PartnerId]),
    [FlagSlicerAND]
  )
发布评论

评论列表(0)

  1. 暂无评论