Forum Discussion

Colin_Davis's avatar
Colin_Davis
Frequent Visitor
1 year ago
Solved

MAX value with Filter or If

I want to create a New Column that contains True, if this is the higest version for this user, for this course, and the status is completed.  I have the following table called Main:   User Name ...
  • bhanu_gautam's avatar
    1 year ago

    Colin_Davis , Create a new column using

     

    DAX
    Highest Version =
    VAR CurrentUser = 'Main'[User Name]
    VAR CurrentCourse = 'Main'[Course Title]
    VAR CurrentVersion = 'Main'[Version]
    RETURN
    IF(
    'Main'[Status] = "Completed" &&
    CurrentVersion =
    CALCULATE(
    MAX('Main'[Version]),
    FILTER(
    'Main',
    'Main'[User Name] = CurrentUser &&
    'Main'[Course Title] = CurrentCourse &&
    'Main'[Status] = "Completed"
    )
    ),
    TRUE,
    BLANK()
    )