Forum Discussion

JaviGoldstein's avatar
JaviGoldstein
New Member
2 years ago
Solved

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 ...
  • Anonymous's avatar
    Anonymous
    2 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.