Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bo_afk
Post Patron
Post Patron

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? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bo_afk , Try a new column like

 


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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@bo_afk , Try a new column like

 


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.