Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Topjacket
Helper I
Helper I

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

 

The only way I could think to do this was to copy the data table so I have 2 versions of it, I could then apply the slicers to the individual data sets but I can't see a way of restricting the slicer to only look at one data table.

 

Is there a way to restrict a slicer to only look at one data table?

 

Is there a better/easier way to go about achieving this?

 

Thanks in advance for any help

1 ACCEPTED SOLUTION

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:

model.jpgNow 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

2slicers3.gif

 

 I've attached the sample file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

9 REPLIES 9
PaulDBrown
Community Champion
Community Champion

You can share the PBIX file via a cloud service (OneDrive, Google Drive, Deopbox....)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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:

model.jpgNow 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

2slicers3.gif

 

 I've attached the sample file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.

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

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks again Paul, this is really useful.

PaulDBrown
Community Champion
Community Champion

Can you show a depiction of the model and provide sample data or PBIX file?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi Paul

 

Thanks for your quick reply, I have built a very basic mock up of what I am trying to do. I need the slicers to work against the individual columns in the chart so I can compare the 2 values but I can't see a way of making them work independently. I have just seen that I can't upload a pbix so have added some pictures. Please let me know if you need more information.

 

I hope this makes sense.

 

Thanks again

 

Topjacket_0-1648492717205.pngTopjacket_1-1648492771596.png

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.