Forum Discussion
creating a monthly average column
I am trying to create a monthly average column for an exchange rate table. Here is a screenshot of the the table structure:
What would be the best way to calculate a monthly average rate per combo in the table? Thx!
- Anonymous2 years ago
Hi JaviGoldstein ,
Please try to create a new column with below dax formula:
Column = VAR cur_combo = [Combo] VAR cur_date = [Date] VAR cur_year = YEAR ( cur_date ) VAR cur_month = MONTH ( cur_date ) VAR tmp = FILTER ( 'Table', [Combo] = cur_combo && YEAR ( [Date] ) = cur_year && MONTH ( [Date] ) = cur_month ) RETURN AVERAGEX ( tmp, [Rate] )Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- FreemanZ
Super User
hi JaviGoldstein ,
try to plot a table visual with Month Column from your calendar table and a measure like:
measure = AVERAGE(data[Rate])
- AnonymousNot applicable
Hi JaviGoldstein ,
Please try to create a new column with below dax formula:
Column = VAR cur_combo = [Combo] VAR cur_date = [Date] VAR cur_year = YEAR ( cur_date ) VAR cur_month = MONTH ( cur_date ) VAR tmp = FILTER ( 'Table', [Combo] = cur_combo && YEAR ( [Date] ) = cur_year && MONTH ( [Date] ) = cur_month ) RETURN AVERAGEX ( tmp, [Rate] )Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.