Forum Discussion
DAX Function for COUNTIF and/or CALCULATE
- 10 years ago
Hi ksobota,
Based on your scenario, you can use the DAX below on your INDIVIDUAL table.
CountUser = CALCULATE(COUNTA(EMPLOYMENTS[Member_C]),FILTER(ALL(EMPLOYMENTS),EMPLOYMENTS[Member_C]=INDIVIDUAL[User_ID]))
Regards,
Charlie Liao
I have a similiar issue, but this time i want to replicate =COUNTIF($J$2:J2,J2)
So I want the table to count out each of the instances that value is seen. See below example
Kris 1
Kris 2
Kris 3
John 1
Ed 1
Kris 4
Ed 2
- mamoormasoomi8 years ago
Helper I
Did you find the answer to the question? I have the similar issue. Please see below and let me know please if you can help me to get the solution.
- Anonymous8 years agoNot applicable
Hi All,
I am looking for the similar query. I have created a calculated columns in Power BI.
We need to calculate “total shipment count” in Power BI. For calculating total shipment count we need to apply two conditions:
- If the “Plant_Shpto_Shpment_Gross KG” is 0 then shipment count will be 0.
- Secondly, we have to compare the consecutive rows of the “Plnt_Ship-to_Shpmt_Mat” column. Please refer the snapshot below to view the formula used to get the desired shipment count in Excel. If the values in the consecutive rows are same, it should return 0 as shipment count
I have used following formula in power BI but its showing error.
DAX FormulaCan someone please help me to get the output.
Thanks
- Anonymous8 years agoNot applicable
It seems that the column Plant_Ship-to_Shipment_Material type is set to Text. Change it to Number
- zairol_hamdan6 years agoRegular Visitor
Hi there, I'm having this issue as well. Did you manage to solved? Tks
- EILOOP6 years ago
Advocate I
On Page 2 of the thread...
I was able to accomplish this through variables.
For example I wanted to count the times an employee name appeared in my employee name column, since each row is unique to the entire column i stored this value as a var in Formual Bar.
This will work just like a Count If based on the current value of the Row.
Column Name =
var employee_name = Table[Employee Name]
var Outcome = CALCULATE(COUNT(Table[Employee Name]),FILTER(Table,Table[Employee Name]= employee_name))
Return
Outcome