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 August 31st. Request your voucher.
Hi,
I have dummy data for employee and their sales values.
I am trying to get a dax code for the following:
- Count of Emp Sales: count number of employees (by unique id) who made a sale (regardless of the values including 0) ( only to exclude blanks).
- Count sales: count of sales per manager
- Count of no sales: count of no sales per manager
Expected outcome based on the sample data:
Manager | Total Employee | Count of Emp Sales | Count of Sales | Count of no Sales |
Basilius Josip | 4 | 4 | 6 | 2 |
Drika Eurig | 5 | 4 | 6 | 2 |
Eadburga Yasmeen | 4 | 3 | 6 | 2 |
Gergana Nellie | 2 | 2 | 5 | 3 |
Halvor Suerius | 2 | 2 | 8 | 0 |
Jamal Mohan | 3 | 3 | 10 | 2 |
Kağan Dreda | 6 | 6 | 18 | 6 |
Mari Felizitas | 1 | 2 | 7 | 1 |
Shahin Zlata | 2 | 2 | 7 | 1 |
Vendelín Rati | 2 | 2 | 7 | 1 |
Total | 31 | 30 | 80 | 20 |
Many thanks.
Solved! Go to Solution.
Hi @H_insight
Try this:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi Heshamk:
That was interesting! If you have a data model vs. flattened file it will be better for any kind of analysis.
Please see link for results:
https://drive.google.com/file/d/1SNTX1VLuiWsDODT_rYGXKNl5OPBbeFAO/view?usp=sharing
Thanks for the quick response. I appreciate I have a flat file, but it's only due to having a sample file 🙂
I think most of my requirements has been delivered, except "Count of Emp Sales", where out of the 31 unique employees, only 1 didnt make any sales. The outcome should be 30.
I.e. Manager Drika Eurig, have 5 employees. 4 made sales excet 1.
Hope that helps.
Hi @H_insight
Try this:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |