The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi I need help with creating two measures to calculate employee bonuses.
I have such a report and I would like to calculate two measures in the lower table:
The first measure "Percentage of orders from category 1" - it is supposed to tell what percentage of all orders of a given employee are orders from category 1
The second measure: "Bonus" - for each order, if for a given agent, the percentage of orders from the first category is greater than 50%, then the bonus for the order is 20, and if it is below, 10
Here is what the result table should look like:
Order ID | order_date | seller | category | Percentage of orders from category 1 | Bouns |
1 | 01.07.2023 | A | cattergory 1 | 25% | 10 |
2 | 01.07.2023 | A | cattergory 2 | 25% | 10 |
3 | 04.07.2023 | B | cattergory 1 | 100% | 20 |
4 | 05.07.2023 | C | cattergory 2 | 0% | 10 |
5 | 07.07.2023 | B | cattergory 1 | 100% | 20 |
6 | 07.07.2023 | A | cattergory 2 | 25% | 10 |
Source data:
Order ID | order_date | seller | category |
1 | 01.07.2023 | A | cattergory 1 |
2 | 01.07.2023 | A | cattergory 2 |
3 | 04.07.2023 | B | cattergory 1 |
4 | 05.07.2023 | C | cattergory 2 |
5 | 07.07.2023 | B | cattergory 1 |
6 | 07.07.2023 | A | cattergory 2 |
7 | 08.07.2023 | C | cattergory 1 |
8 | 15.08.2023 | C | cattergory 2 |
9 | 16.08.2023 | C | cattergory 1 |
10 | 17.08.2023 | C | cattergory 2 |
please provide with more explaiantion this is not clear of what you want how is your percentage calculated? how is your orders calculated?
this is what i got but different from your reults
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |