The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I am trying to calculate the number of staff that meet certain criteria. I have written a DAX formular but it doesn't give me what i expect. I broke the formular into small bits and i got various numbers of staff but putting it together, and i get just 2. I have used excel to create a pivot table and i get about 600. This is the formular i wrote
Solved! Go to Solution.
Hi @Kaycee_1 ,
Pleasemake sure whether the conditons in your code are AND logic or OR logic. As far as I know, your code above will run as AND logic, so only data meet all conditions will be counted. You can try Filter and OR() function to achieve your goal.
Here I create a sample to show you And and Or logic.
Or = CALCULATE(COUNT('SIP (2)'[Assignment ID]),FILTER('SIP (2)','SIP (2)'[Assignment Status] IN {"A","B","C"}||MAX('Org L3'[Org L3]) in {"O1","O2"}))
And = CALCULATE(COUNT('SIP (2)'[Assignment ID]),'SIP (2)'[Assignment Status] IN {"A","B","C"},'Org L3'[Org L3] in {"O1","O2"})
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Kaycee_1 ,
Pleasemake sure whether the conditons in your code are AND logic or OR logic. As far as I know, your code above will run as AND logic, so only data meet all conditions will be counted. You can try Filter and OR() function to achieve your goal.
Here I create a sample to show you And and Or logic.
Or = CALCULATE(COUNT('SIP (2)'[Assignment ID]),FILTER('SIP (2)','SIP (2)'[Assignment Status] IN {"A","B","C"}||MAX('Org L3'[Org L3]) in {"O1","O2"}))
And = CALCULATE(COUNT('SIP (2)'[Assignment ID]),'SIP (2)'[Assignment Status] IN {"A","B","C"},'Org L3'[Org L3] in {"O1","O2"})
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
15 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |