Forum Discussion
Card to show CountIf
Hi team,
My excel column has a list of Yes and No and I want the Card visual in power BI to count the number of "Yes" and another card to count the number of "No". At the moment the card is just showing text? I want to have a forumla in both cards that reads, Countif(column,"yes") and return that number.
Im a new user here so not quite sure how to do it. All step by step suggestion welcome. Thank you.
drag the column on to a card.
Change the summarization to COUNT -> from the dropdown in the field well.
That will give you a count of all values.
--------------------
open the Filter pane. Drag the column in to the filter pane. Select basic filtering. You should see the values 'yes', 'no' beneath that. Choose one.
---------------------
When you have that working, do it all again for the other choice (yes or no).
godd luck
- Anonymous5 years ago
Hi herefortryouts ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create measure.
Yes = var _count=CALCULATE(COUNT('Table'[yes_no]),FILTER('Table','Table'[yes_no]="yes")) return "Countif(column,yes)"&"-"&_countNo = var _count=CALCULATE(COUNT('Table'[yes_no]),FILTER('Table','Table'[yes_no]="no")) return "Countif(column,no)"&"-"&_count2. Place the measure in the card.
3. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- HotChilliCommunity Champion
drag the column on to a card.
Change the summarization to COUNT -> from the dropdown in the field well.
That will give you a count of all values.
--------------------
open the Filter pane. Drag the column in to the filter pane. Select basic filtering. You should see the values 'yes', 'no' beneath that. Choose one.
---------------------
When you have that working, do it all again for the other choice (yes or no).
godd luck
- AnonymousNot applicable
Hi herefortryouts ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create measure.
Yes = var _count=CALCULATE(COUNT('Table'[yes_no]),FILTER('Table','Table'[yes_no]="yes")) return "Countif(column,yes)"&"-"&_countNo = var _count=CALCULATE(COUNT('Table'[yes_no]),FILTER('Table','Table'[yes_no]="no")) return "Countif(column,no)"&"-"&_count2. Place the measure in the card.
3. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.