Reputation: 5
I am new to power bi, i am trying to use "state cards" by okviz to create multiple dynamic cards.
i have an example of the following data structure: table 1
Country | Answer
Amercica | Yes
America | NO
America | YES
America | Yes
Brazil | NO
Brazil | NO
Brazil | NO
Brazil | NO
Brazil | yes
how do i create a measure in power bi that counts the yes and no columns per country and gives me the following output
Country | Answer |count
America |Yes |3
America |No |1
Brazil |Yes |1
Brazil |No |4
Upvotes: 0
Views: 4426
Reputation: 1204
First standardize the Answer column. This is not necessary but I don't like all those different yes words.
You don't need a measure to achieve this. You can drag a column and chose the count option. But if you really need a measure use the following expression:
Answer Count = COUNT( 'Table'[Answer] )
Both ways you obtain the same result.
Upvotes: 1