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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
cmc099
Frequent Visitor

Creating visual to show overlap between groups?

I have a table that has the names of people and the groups that they belong to. For example, the table looks like the following:

 

Worker nameGroup name
John HendersonEconomy
John HendersonFinance
John HendersonIT
Scott SmithEconomy
Scott SmithIT
Scott SmithSales
Scott SmithMarketing
Denise LockmanSales
Denise Lockman

Finance

 

What I want to do is create a visualisation such that I have a slicer that I can select multiple names from, and the groups that these names all belong to are displayed. For example, if I chose John Henderson and Scott Smith, Economy and IT would be displayed, if I chose Scott Smith and Denise Lockman, Sales would be displayed, if I chose John Henderson, Scott Smith and Denise Lockman, no groups would be displayed etc.

 

I have tried duplicating the table and creating another table with the intersection between the two tables but I could not get it to work. I also tried pivotting out the column 'Group name' and filled the new columns with 1 and 0's depending on if they belong to each group or not, but that also does not work (I should also mention that in my real data set I have over 400 unique names and 400 unique groups).

 

I'm sure there is a simple way of displaying what I want but I cannot figure it out. Would anyone know how I might go about this?

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@cmc099,

 

This solution uses a separate table for the visual in order to break the link between slicer and visual. The original table is named Workers.

 

1. Create calculated table:

 

WorkersVisual = Workers

 

2. Create measure:

 

Visual Filter = 
VAR vWorkerCountSlicer =
    COUNTROWS ( VALUES ( Workers[Worker name] ) )
VAR vWorkerGroup =
    TREATAS ( VALUES ( WorkersVisual[Group name] ), Workers[Group name] )
VAR vWorkerCountInGroup =
    COUNTROWS ( CALCULATETABLE ( VALUES ( Workers[Worker name] ), vWorkerGroup ) )
VAR vResult =
    IF ( vWorkerCountSlicer = vWorkerCountInGroup, 1 )
RETURN
    vResult

 

3. Create a slicer using Workers[Worker name].

 

4. Create a table visual using WorkersVisual[Group name].

 

5. Add the measure Visual Filter to the table visual as a filter:

 

DataInsights_0-1663084510271.png

 

Result:

 

DataInsights_1-1663084567992.png

---

 

DataInsights_2-1663084615122.png

---

 

DataInsights_3-1663084652659.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@cmc099,

 

This solution uses a separate table for the visual in order to break the link between slicer and visual. The original table is named Workers.

 

1. Create calculated table:

 

WorkersVisual = Workers

 

2. Create measure:

 

Visual Filter = 
VAR vWorkerCountSlicer =
    COUNTROWS ( VALUES ( Workers[Worker name] ) )
VAR vWorkerGroup =
    TREATAS ( VALUES ( WorkersVisual[Group name] ), Workers[Group name] )
VAR vWorkerCountInGroup =
    COUNTROWS ( CALCULATETABLE ( VALUES ( Workers[Worker name] ), vWorkerGroup ) )
VAR vResult =
    IF ( vWorkerCountSlicer = vWorkerCountInGroup, 1 )
RETURN
    vResult

 

3. Create a slicer using Workers[Worker name].

 

4. Create a table visual using WorkersVisual[Group name].

 

5. Add the measure Visual Filter to the table visual as a filter:

 

DataInsights_0-1663084510271.png

 

Result:

 

DataInsights_1-1663084567992.png

---

 

DataInsights_2-1663084615122.png

---

 

DataInsights_3-1663084652659.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This is perfect! Thanks very much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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