Forum Discussion
Set Slicer to only work on 1 data table
- 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
Thanks again.
Have had a bit of trouble getting a sharable link due to company restrictions. I have pasted a link below.
https://drive.google.com/file/d/13_per3vcB2Jrd7aLg2216tKE7Algx4CX/view?usp=drivesdk
Cheers
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
- Topjacket4 years ago
Helper I
Thank you very much for this. Its brilliant!!
Its doing exaclty what I need.
I'm going to read up on the dimention bit as thats all new to me.
- PaulDBrown4 years ago
Community Champion
A Dimension table is a table containing unique values from a field in your fact table(s) with a relationship with the corresponding field in your fact table(s). They make the model more efficient among other benefits. They can be created in Power Query or using DAX. I created them using DAX with the DISTINCT function. (See the code in the sample file).
they are extremely useful and a recommended best practice.- Topjacket4 years ago
Helper I
Thanks again Paul, this is really useful.
- PaulDBrown4 years ago
Community Champion
To make the visual clearer, you can create a measure to use as a title with:
Visual Title = "Count of " & SELECTEDVALUE(Dim Customer [Customer Name]) & " compared to the average count of " & CONCATENATEX(VALUES(Customer Group [Customer Name]), Customer Group [Customer Name], ", ")
Select the visual, go to Title under General in the formatting pane, select the fx icon and under value select [Visual Title] measure