The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |