Forum Discussion

dannyboy123's avatar
dannyboy123
Frequent Visitor
2 years ago
Solved

Filtering a measure

Hi.   I have the following data in a table... The left hand column is week number.  I want to create a measure that always returns the latest week only.  I've been trying for a few hours and...
  • ray_aramburo's avatar
    2 years ago

    Try this:

    First create a measure that will get your maximum week:

    LatestWeek = CALCULATE(MAX('TableName'[YourWeekColumn]),ALL('TableName')) 

    Then create another measure:

    LatestWeekFlag = LatestWeekFlag = IF(SELECTEDVALUE('TableName'[YourWeekColumn] = [LatestWeek], 1, 0)

    Use it as a filter: