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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Showing the amount of values that another value is shared with

Hello everyone, I wondering if anyone could help me out.

 

Let's say I have a table named 'Teams' with three columns filled with data about (fictitious) sports teams. RegionID refers to their region, TeamID is a unique identifier for the team, and a third column contains Team name.

 

'Teams'

RegionIDTeamIDTeam name
100 20FC Kolping
100 30FC Dynamo
100 40FC SVV
20045FC St. Mary
20055FC Arnhem
30060FC Kickers

 

 

What I would like is showing a slicer on a Team name in my dashboard so I can filter a football team. This isn't the tricky part. However, what I would also like is a measure or a column that tells me how many teams there are within the filtered teams' region.

 

For example: if you were to filter 'FC Kolping', the measure would say: 3. Because there are 3 teams in the region that FC Kolping is in. If you would filter FC Arnhem, the measure would say 2, and so on. I would like to know whether this is possible and how I could achieve it. Hopefully I have explained my question well. If not, please let me know.

 

Thanks so much in advance! - Alex

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

@Anonymous ,

 

You can create this measure:

 

_QtdeTeamsInRegion = 
VAR _selectedRegion = SELECTEDVALUE('Table'[RegionID])
RETURN CALCULATE(COUNT('Table'[RegionID]), FILTER(ALL('Table'), 'Table'[RegionID] = _selectedRegion))

 

Capture.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
Anonymous
Not applicable

That worked! Thank you very much.

camargos88
Community Champion
Community Champion

@Anonymous ,

 

You can create this measure:

 

_QtdeTeamsInRegion = 
VAR _selectedRegion = SELECTEDVALUE('Table'[RegionID])
RETURN CALCULATE(COUNT('Table'[RegionID]), FILTER(ALL('Table'), 'Table'[RegionID] = _selectedRegion))

 

Capture.PNG

 



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

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

April Fabric Community Update

Fabric Community Update - April 2024

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

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

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

Top Solution Authors