Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everybody,
I have a dataset where each row is an inspection (INS A & INS B) or an observation (OBS) of an employee (fake data):
Naam | Jaar | Target | Type | Nummer | Naam | Jaar |
Jan Janssen | 2020 | 2 | INS A | I001 | Jan Janssen | 2020 |
Jan Janssen | 2020 | 2 | INS B | I002 | Jan Janssen | 2020 |
Jan Janssen | 2021 | 4 | INS A | I003 | Jan Janssen | 2021 |
Jan Janssen | 2021 | 4 | INS B | I004 | Jan Janssen | 2021 |
Jan Janssen | 2021 | 4 | INS A | I005 | Jan Janssen | 2021 |
Jan Janssen | 2022 | 6 | INS A | I006 | Jan Janssen | 2022 |
Jan Janssen | 2022 | 6 | INS B | I007 | Jan Janssen | 2022 |
Jan Janssen | 2022 | 6 | INS A | I008 | Jan Janssen | 2022 |
Jan Janssen | 2022 | 6 | INS B | I009 | Jan Janssen | 2022 |
Bart Smit | 2019 | 2 | OBS | OBS001 | Bart Smit | 2019 |
Bart Smit | 2020 | 2 | OBS | OBS002 | Bart Smit | 2020 |
Bart Smit | 2021 | 2 | OBS | OBS003 | Bart Smit | 2021 |
In each row the target of the employee for that year is shown. So, for example, Jan Janssen has a target of 6 inspections in 2022, but has only done 4 inspections (4 rows).
I want to check for everybody if they reached their target for inspections or not. I use the following measure for calculating the number of inspections for each employee:
Hi @MartijmH ,
Since your [Inspecties gehaald] return 1 or 0, you can sum a measure. Try the SUMX function.
Measure = SUMX('TABLENAME', [Inspecties gehaald])
OR try to count the measure.
Measure = COUNTX('TABLENAME', [Inspecties gehaald])
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-stephen-msft,
Thank you for your response. I tried both measures, but unfortunately both are not working.
For the year 2022, the SUMX() measure gives back 0 (can't figure out why) and the COUNTX() gives back 4 (because Jan Janssen has 4 inspections out of 6). However, I want it to give me 1 as there is one employee that did not reach his target.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |