Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm practicing my Power BI skills. I've downloaded a csv file which contains data about olympic games. The dataset has many columns, such as country, athlete name, year, sport, event, medal which the athlete has won, olympic city, etc.
The problem is that I want to create a bar graph that display country name by medal types count. However if create a graph "Country" by "Medal" from original csv it will not display the correct numbers of medals, because if a country wins a medal in a team sport (like volleyball or football) it should count as only one medal, and not the sum of all medals of all athletes in that team. This could be solved by removing Athlete column and selecting distinct values of "Event" collumn, like creating a table using the following formula:
The same number also appears if I select any medal type from filter option (Gold, Silver or Bronze).
I have no idea how to fix this. How can I create a measure that shows the correct number of medal type for every country?
Solved! Go to Solution.
HI @lipao255,
You can try to use the following measure formula to get the count based on country, event, and medal group:
formula =
CALCULATE (
COUNT( Table[Medal] ),
ALLSELECTED ( Table ),
VALUES ( Table[Country] ),
VALUES ( Table[Event] ),
VALUES ( Table[Medal] )
)
Regards,
Xiaoxin Sheng
HI @lipao255,
You can try to use the following measure formula to get the count based on country, event, and medal group:
formula =
CALCULATE (
COUNT( Table[Medal] ),
ALLSELECTED ( Table ),
VALUES ( Table[Country] ),
VALUES ( Table[Event] ),
VALUES ( Table[Medal] )
)
Regards,
Xiaoxin Sheng
Up, I need some help.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 29 | |
| 21 | |
| 12 | |
| 12 |