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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.