Forum Discussion
Calculate average price based on certain condition
Hi,
thanks so much for all the support, I tested the file attached, but the result is not what it should be. Please find enclosed how should be calculated the avg based on the top price with a PZ amount excatly macthing with the 10% of total PZ.
Considering that the 10% is 350, I will take all the agents with till the total is equal to the 10% (A-B-C). now the total doesn't match because it is 370, so from the last will be used 200 (370-350 is 20, so from C=220, to match to 350 we reduct it by 20). Then we need to moltiply the PZ for the EUR/pz, but for agent C will be 200*8,08. The total will be diveded by the 10%(350). The result is 8.767. In the power BI file the Top10Pct_Avg_Price is 9.29. Hope I was clear. Thanks!
Hi Nun ,
I’ve reviewed and updated the file. It appears the difference in results was due to a mismatch between your dataset and the one I initially referenced.
The calculations and measures you used were correct—no issues there. The logic was sound; only the data source differed.
I am also including the screenshot for your reference:
Please feel free to open the file and explore the visuals and calculations.
Thank you.
- Anonymous1 year agoNot applicable
Hi @Nun ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.- Nun1 year ago
Resolver I
Hi, thanks for supporting.
I am testing it, because our scenario is a little different. First of all Eur/PZ is a measure, we have Eur for each row. It means we have the same agent that can buy the same product for several times in the same quarter, with different prize (Eur) and different quantity (PZ).
- Anonymous1 year agoNot applicable
Hi Nun ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.