Forum Discussion
stellaliu
8 years agoRegular Visitor
COUNTIF in POWERBI
Hi,
I'm stuck in how to translate COUNTIF function in Excel to PowerBI language. Here is the example of my case:
I want to count how many "check" in one row, and row G is what I need. I can easily use COUNTIF in excel to count, but I don't know how to do it in PowerBI.
Really appreciate your help!
Stella
2 Replies
- Greg_Deckler
Community Champion
The problem here isn't so much COUNTIF (you use CALCULATE for that in Power BI) but rather the multi-column aggregation that you want to do. See my quick measures here:
- danextian
Super User
Hi stellaliu,
Is that how you loaded your data into the model? If so, you'll have go to the query editor and unpivot it so your table now looks something like this:
No Attribute Value 1 JAN 1 FEB 1 MAR check 1 APR 1 MAY 2 JAN 2 FEB 2 MAR 2 APR 2 MAY 3 JAN check 3 FEB 3 MAR 3 APR 3 MAY check 4 JAN 4 FEB 4 MAR 4 APR 4 MAY 5 JAN 5 FEB 5 MAR 5 APR 5 MAY 6 JAN 6 FEB 6 MAR check 6 APR 6 MAY Here's a video on how to do it: How to Unpivot Data with Power Query