Forum Discussion
Weighted Average every 24 hours
- Anonymous6 years ago
Hi Yak2792 ,
First, please add one Index field for the related table in Power Query Editor. Then create a calculated column to get the average of Weighted Bonus:
Weighted Bonus = DIVIDE ( CALCULATE ( MAX ( 'Bonus'[Bonus Calculation] ), FILTER ( ALL ( 'Bonus' ), 'Bonus'[Index] - 1 = EARLIER ( 'Bonus'[Index] ) ) ) * 12 + 'Bonus'[Bonus Calculation] * 12, 24 )add index column
create calculated columnBest Regards
Rena
I should also mention that this is currently all done with measures, and is being presented in a table.
- amitchandak6 years ago
Super User
Can you share some sample actual raw data.
- Yak27926 years agoRegular Visitor
What raw data would you need? The data is coming from 4 different SQL tables, so it might be a bit of a mess. I have one table that has the calendar, 2 that contain product information, and another that contains bonus multpliers depending on certain criteria.
Would the table presented in the initial post with details of how the bonus is calculated suffice?
- Anonymous6 years agoNot applicable
Hi Yak2792 ,
First, please add one Index field for the related table in Power Query Editor. Then create a calculated column to get the average of Weighted Bonus:
Weighted Bonus = DIVIDE ( CALCULATE ( MAX ( 'Bonus'[Bonus Calculation] ), FILTER ( ALL ( 'Bonus' ), 'Bonus'[Index] - 1 = EARLIER ( 'Bonus'[Index] ) ) ) * 12 + 'Bonus'[Bonus Calculation] * 12, 24 )add index column
create calculated columnBest Regards
Rena