The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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'
RegionID | TeamID | Team name |
100 | 20 | FC Kolping |
100 | 30 | FC Dynamo |
100 | 40 | FC SVV |
200 | 45 | FC St. Mary |
200 | 55 | FC Arnhem |
300 | 60 | FC 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
Solved! Go to Solution.
@Anonymous ,
You can create this measure:
_QtdeTeamsInRegion =
VAR _selectedRegion = SELECTEDVALUE('Table'[RegionID])
RETURN CALCULATE(COUNT('Table'[RegionID]), FILTER(ALL('Table'), 'Table'[RegionID] = _selectedRegion))
That worked! Thank you very much.
@Anonymous ,
You can create this measure:
_QtdeTeamsInRegion =
VAR _selectedRegion = SELECTEDVALUE('Table'[RegionID])
RETURN CALCULATE(COUNT('Table'[RegionID]), FILTER(ALL('Table'), 'Table'[RegionID] = _selectedRegion))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
20 | |
18 | |
18 | |
18 | |
14 |
User | Count |
---|---|
42 | |
35 | |
23 | |
20 | |
20 |