Forum Discussion
theo
5 years agoHelper III
add multiple columns like countif
Hi, I have 2 questions and this may have been discussed elsewhere but I can't find it. 1. what is the dax required to count each entry - like a countif. see example below, target is Count_RC. ...
- 5 years ago
Hi v-janeyg-msft , thanks for the solution but as mentioned PQ's solution takes a while to complete for my data, so I modified the column expression mentioned initially to a measure instead since I found this tabular editor that can create multiple measures all at once.
calculate(COUNTROWS(FILTER('28Jun_1973',[average diff]='28Jun_1973'[average diff])))Thanks for the help anyway.
selimovd
5 years agoMost Valuable Professional
Hey theo ,
in general you can do a kind of countif by just filtering.
For your first question as example:
Count_RC =
VAR vRowRank = myTable[Rank]
RETURN
CALCULATE(
COUNTROWS( myTable ),
myTable[Rank] = vRowRank
)
Your second question I didn't really understand what you want to achieve. But you can add multiple criteria to your CALCULATE statement if that was the question.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic