Forum Discussion

RRSSDW's avatar
RRSSDW
Icon for Helper I rankHelper I
3 months ago
Solved

Slicer by logic conditions

Kindly I am asking if you have a smarter solution. Question is quite generic. Want to place a single selection slicer that has to show two options only, although the field includes many options. Hav...
  • OwenAuger's avatar
    3 months ago

    Hi RRSSDW 

    To handle this kind of requirement with filter options consisting of overlapping sets, I would usually set up the model as follows (using your example):

    1. Creating a Type dimension (if it doesn't already exist).
    2. Create a Type Filter table containing the combinations of required filter options and corresponding Type values. Type Filter = "A"..."E" correspond to individual Type values of the same name, while Type Filter = "All Content" corresponds to Type = "A"..."E".
    3. Create bidirectional many-to-one relationship between 'Type Filter'[Type] and Type[Type].
    4. Use 'Type Filter'[Type Filter] on the slicer.
    5. Apply a page-level or report-level filter on 'Type Filter'[Type Filter] to limit the options as required, e.g. "A" and "All Content".

    In effect, this models a many-to-many relationship between Type and Type Filter. This avoids having to handle the filtering via DAX.

    This is similar modelling used for overlapping date ranges in this blog post.

     

    Small example PBIX attached.