Forum Discussion

Topjacket's avatar
Topjacket
Icon for Helper I rankHelper I
4 years ago
Solved

Set Slicer to only work on 1 data table

Hi All   I am try to build a column chart that shows the record count for a single customer (selected by slicer) vs the average record count for a group of customers (selected by a different slicer...
  • PaulDBrown's avatar
    PaulDBrown
    4 years ago

    Thanks for the file. See if this works for you. You only need one call table; you need two dimension tables for customer. I've called one Dim Customer and the other Group Customer. Create relationships between these tables and the call table via the customer fileds. Leave the Group Customer relationship inactive. The model looks like this:

    Now create the measures:

     

     

     

    Call Count = 
    SUM('Customer Calls'[number])
    Average count by Group = 
    AVERAGEX('Customer Group', 
    CALCULATE (
        [Call Count],
        REMOVEFILTERS ( 'Dim Customer'[Customer Name] ),
        USERELATIONSHIP ( 'Customer Group'[Customer Name], 'Customer Calls'[Customer Name] )))

     

     

    If you want the selecion in the slicers to be mutually exclussive, you can use this measure as a filter for the Customer group Slicer:

     

    Filter GSlicer = 
    COUNTROWS(
        EXCEPT('Customer Group', 'Dim Customer'))

     

    and this measure as a filter for the customer slicer:

     

    Filter Dim Slicer =
    IF (
        ISFILTERED ( 'Customer Group'[Customer Name] ),
        COUNTROWS ( EXCEPT ( 'Dim Customer', 'Customer Group' ) ),
        1
    )
    

     

    To get

     

     I've attached the sample file