Forum Discussion
JaviGoldstein
2 years agoNew Member
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 ...
- 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.
Anonymous
2 years agoNot 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.