Forum Discussion
ksobota
10 years agoRegular Visitor
DAX Function for COUNTIF and/or CALCULATE
Hello, I am fairly new to Power BI and am even newer to the use of DAX functions. For years I have worked in Excel and know how I would do this there, but am finding the same formula I would use ...
- 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
Anonymous
8 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
Anonymous
8 years agoNot applicable
It seems that the column Plant_Ship-to_Shipment_Material type is set to Text. Change it to Number