Forum Discussion
Narendrawinata
2 years agoNew Member
POWER QUERY = COUNTIF SAME CHARACTER
Hi, I'm struggling to find out how to run CountIf Formula in Power Query. The purpose is to count a certain value in 2 or more column. Here's the example. Thank you
AlienSx
2 years agoSuper User
x is function parameter (variable) taking a value of current row of the table (in the form of record). Use code below if you feel comfortable to use each
Table.AddColumn(
your_table,
"TOTAL",
each List.Count(
List.PositionOf(
Record.FieldValues(_),
"P",
Occurrence.All
)
)
)
Narendrawinata
2 years agoNew Member
Sorry i still don't understand, the result was error, i think it's because this part. Can you help me? and why using underscore in record field values below
Record.FieldValues(_),
"P",
Occurrence.All
Thank you so much