admin 管理员组

文章数量: 1086019

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]
  )

本文标签: powerbiFiltering data in SSAS based on quotANDquot not quotORquotStack Overflow