Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 formula:
Region 2 | Alexandria | AO | 2 |
Region 2 | Alexandria | Crane | 0 |
Region 2 | Alexandria | CRO | 0 |
Region 2 | Alexandria | EO | 0 |
Region 2 | Alexandria | UO | 0 |
Here is what I am getting in Power BI
Region Facility Position Non Qual
Region 2 | Alexandria | AO | 14 |
Region 2 | Alexandria | Crane | |
Region 2 | Alexandria | CRO | 14 |
Region 2 | Alexandria | EO | 14 |
Region 2 | Alexandria | UO | 14 |
So the DAX Formula should be referencing another Table 'All User Listing' and counting the Occurences of "Non Qual" for each Position('All User Listing'[OPS Position Standing (if applicable)]) at each facility('All User Listing'[Facility]). I have been trying to use FILTER and RELATE in the formulas but I cant seem to get those to work at all. So the DAX formula for the Column should call to the table 'All User Listing' and then count the occurance of 'All User Listing'[OPS Qualification Level (if applicable)] = "Non Qual" for each Position 'All User Listing'[OPS Position Standing (if applicable)]
Any help or guidance would be helpful. Thank you.
Solved! Go to Solution.
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:
Hi @Anonymous ,
Could you please share the pbix file or sample data and expected result to us for analysis?
The DAX query you shared will count the rows of all items whose '[OPS Qualification Level (if applicable)] ="Non Qual" in your table, each item will have the same value.
Best Regards,
Teige
@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
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:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
122 | |
80 | |
47 | |
44 | |
35 |
User | Count |
---|---|
182 | |
83 | |
70 | |
47 | |
45 |