Forum Discussion
Anonymous
2 years agoNot applicable
Help with a CountIf function in Power BI
Hello! I have a Countif function in Excel that I need to replicate in PowerBI. Excel function: Countifs(B:B,B1,C:C,"Date In Service") A B C 2 Project...
- 2 years ago
Anonymous
why 2 for project A? We only see one Date in Service for project A.
pls see if this is what you want
Column = countx(FILTER('Table','Table'[B]=EARLIER('Table'[B])&&'Table'[C]="Date In Service"),'Table'[B]) - 2 years ago
You can create a calculated column like that in your table
Please see, if this is what you wantColumnA =CALCULATE(COUNTROWS(Project),FILTER(Project,Project[ColumnB] = EARLIER(Project[ColumnB]) &&Project[ColumnC] = "Date In Service")) - Anonymous2 years ago
Hi Anonymous
Thanks for the reply from ryan_mayu and muhammad_786_1.
Anonymous , you can create a calculated column as follows
Column = CALCULATE(COUNT('Table'[B]), FILTER(ALLEXCEPT('Table', 'Table'[B]), [C] = "Date In Service"))Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
2 years agoSuper User
Anonymous
why 2 for project A? We only see one Date in Service for project A.
pls see if this is what you want
Column = countx(FILTER('Table','Table'[B]=EARLIER('Table'[B])&&'Table'[C]="Date In Service"),'Table'[B])
muhammad_786_1
2 years agoSolution Supplier
You can create a calculated column like that in your table
Please see, if this is what you want
ColumnA =
CALCULATE(
COUNTROWS(Project),
FILTER(
Project,
Project[ColumnB] = EARLIER(Project[ColumnB]) &&
Project[ColumnC] = "Date In Service"
)
)