Forum Discussion
Anonymous
7 years agoNot applicable
Replicating Excel COUNTIF w/ DAX formula errors
Good Afternoon, I am trying to replicate a COUNTIF formula in excel (=COUNTIF('Employee Data'!J:J,B6&"-"&C6&"-"&"Non Qual")) in Power BI, but I am running into some issues. Here is my DAX fo...
- Anonymous7 years ago
The relationships are all set up. Unfortanetly I cant share the pbix due to some of the data. But I was able to get it working with the below formula:
Non Qual = if( isblank(CALCULATE(COUNTROWS('All User Listing'), Filter('All User Listing', AND('All User Listing'[OPS Qualification Level (if applicable)] ="Non Qual", 'All User Listing'[OPS Position Standing (if applicable)] = 'Benchmark Chart'[Position])))), 0, CALCULATE(COUNTROWS('All User Listing'), Filter('All User Listing', AND('All User Listing'[OPS Qualification Level (if applicable)] ="Non Qual", 'All User Listing'[OPS Position Standing (if applicable)] = 'Benchmark Chart'[Position]))))
Anonymous
7 years agoNot applicable
Anonymous - If you're trying to create a Calculated Column in an unrelated table, then it won't work, because there is no filtering based on the Region, etc. You could try it in a Measure, but you would still face the same issue if the tables are not related.
I think you need to get the relationships hooked up first. Could you share your pbix?
Cheers!
Nathan
Anonymous
7 years agoNot applicable
The relationships are all set up. Unfortanetly I cant share the pbix due to some of the data. But I was able to get it working with the below formula:
Non Qual = if( isblank(CALCULATE(COUNTROWS('All User Listing'), Filter('All User Listing', AND('All User Listing'[OPS Qualification Level (if applicable)] ="Non Qual", 'All User Listing'[OPS Position Standing (if applicable)] = 'Benchmark Chart'[Position])))), 0, CALCULATE(COUNTROWS('All User Listing'), Filter('All User Listing', AND('All User Listing'[OPS Qualification Level (if applicable)] ="Non Qual", 'All User Listing'[OPS Position Standing (if applicable)] = 'Benchmark Chart'[Position]))))