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 Experts!
I have two tables, one containing the monthly incentive amount for each store counter, and the other containing the sales personnel for each store counter and whether they have reached the monthly target. I want to calculate the incentive amount for each store counter to be evenly distributed only among the sales personnel who have reached their monthly targets.
Solved! Go to Solution.
Hi @Lily36876
The solution @ryan_mayu provided is excellent, I want to offer some more information for you to refer to, the sample data is the same as you provided.
You can create the following measure.
MEASURE =
VAR a =
CALCULATE (
MAX ( 'Monthly incentive amount'[Incentive] ),
'Monthly incentive amount'[ShopNo]
= MAX ( 'Sales personnel store counter'[ShopNo] ),
'Monthly incentive amount'[YearMonth]
= MAX ( 'Sales personnel store counter'[YearMonth] )
)
VAR b =
CALCULATE (
COUNTROWS ( 'Sales personnel store counter' ),
ALLSELECTED ( 'Sales personnel store counter' ),
'Sales personnel store counter'[ShopNo]
IN VALUES ( 'Sales personnel store counter'[ShopNo] ),
'Sales personnel store counter'[YearMonth]
IN VALUES ( 'Sales personnel store counter'[YearMonth] ),
'Sales personnel store counter'[Achieve] = "YES"
)
RETURN
IF (
MAX ( 'Sales personnel store counter'[Achieve] ) <> BLANK (),
DIVIDE ( a, b )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
how to calculate the incentive column?
Proud to be a Super User!
Identify sales in the store who have achieved the performance targets, and then evenly distribute the incentive.
why there is no value for 078?
Proud to be a Super User!
078 didn't reach the target in 2024/01 ,so can't got the incentive~
Thanks
Yes It's what I want!!!
But the pivot table I provide is after summerize in Dax
Hi @Lily36876
The solution @ryan_mayu provided is excellent, I want to offer some more information for you to refer to, the sample data is the same as you provided.
You can create the following measure.
MEASURE =
VAR a =
CALCULATE (
MAX ( 'Monthly incentive amount'[Incentive] ),
'Monthly incentive amount'[ShopNo]
= MAX ( 'Sales personnel store counter'[ShopNo] ),
'Monthly incentive amount'[YearMonth]
= MAX ( 'Sales personnel store counter'[YearMonth] )
)
VAR b =
CALCULATE (
COUNTROWS ( 'Sales personnel store counter' ),
ALLSELECTED ( 'Sales personnel store counter' ),
'Sales personnel store counter'[ShopNo]
IN VALUES ( 'Sales personnel store counter'[ShopNo] ),
'Sales personnel store counter'[YearMonth]
IN VALUES ( 'Sales personnel store counter'[YearMonth] ),
'Sales personnel store counter'[Achieve] = "YES"
)
RETURN
IF (
MAX ( 'Sales personnel store counter'[Achieve] ) <> BLANK (),
DIVIDE ( a, b )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your amazing and useful and right solution!!!!
you can group by data in PQ.
https://learn.microsoft.com/en-us/power-query/group-by?wt.mc_id=DP-MVP-5004616
or pls provide the raw data
Proud to be a Super User!
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |