Forum Discussion

bo_afk's avatar
bo_afk
Icon for Post Patron rankPost Patron
5 years ago
Solved

Flag max per category

I currently have a column which flags the latest week number in the table using the formula below. 

Max WeekNumber flag = IF(TABLENAME[WeekNumber] = MAXA(TABLENAME[WeekNumber]),1,0)

If the week number is equal to the max week number of the data, then assign the value 1, else 0. I have another column in my data for year but the latest week number for 2020 is 53 but for 2019 its 52.

 

How can I flag the latest week number for each year? 

  • bo_afk , Try a new column like

     


    Max WeekNumber flag = IF(TABLENAME[WeekNumber] = MAXX(filter(TABLENAME,[Year] = earlier([year])),[WeekNumber]),1,0)

1 Reply

  • bo_afk , Try a new column like

     


    Max WeekNumber flag = IF(TABLENAME[WeekNumber] = MAXX(filter(TABLENAME,[Year] = earlier([year])),[WeekNumber]),1,0)