Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

The MAX function only accepts a column reference as an argument

While creating calcualted column: could youplease help me how to use max for single values.... max accepts only column instead of value    _MeqY2 = // then If(([USAGE_DATE]<=Max(DateAdd("dd",Da...
  • VahidDM's avatar
    VahidDM
    4 years ago

    Hi Anonymous 

     

    You don't need to use MAX in your dormula, remove Max and just type your Variable names.

     

    Try this:

     

    _MeqY2 =
    VAR adddays =
        DAY ( TODAY () ) + [_SelectedMonthYear]
    VAR last5 =
        DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 5, 1 )
    RETURN
        IF (
            'Usage Tracking'[USAGE_DATE] <= adddays
                && 'Usage Tracking'[USAGE_DATE] >= last5,
            1,
            0
        )

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/