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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Max Month Number per Year

Hello All,

 

I'm wanting to return the max monthnumber for each year. For the example below 2018 would return 12 AND 2019 will return 9. I will then be using that calculation to divide a measure to get a average for the year. 

 

 
 
 
 
1 ACCEPTED SOLUTION

@Anonymous ,

 

Create a below meaure to get Max monthnumber.

 

Max Month Number = CALCULATE(Max(Sheet9[MonthNumber]),ALLEXCEPT(Sheet9,Sheet9[Year]))
 
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

 
12018
102018
112018
122018
62018
72018
52018
92019
42019
12019
22019
32019
52019
  

Hey,

 

Here is two forumulas you can use either.

 

1.Maxmonth = MAX('Table'[Number])

 

2.MaxMonth = CALCULATE(MAX('Table'[Number]),FILTER('Table','Table'[Year]=SELECTEDVALUE('Table'[Year])))

 

Thanks,

Venkata Nalla

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

@Anonymous ,

 

Create a below meaure to get Max monthnumber.

 

Max Month Number = CALCULATE(Max(Sheet9[MonthNumber]),ALLEXCEPT(Sheet9,Sheet9[Year]))
 
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

@Tahreem24 

 

Thank you,

 

When doing this formula I'm getting 9 for both the years 

@Anonymous ,

 

No, I am getting the 9 for 2019 and 12 for 2018. Refer below screen shot.

1.JPG

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

So it may helps other!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

is your monthnumber and year a date field ? 

Anonymous
Not applicable

This is my calculation: 

 

Max Month Number = CALCULATE(MAX(FACT_AreaExpenses_PBuddTable[Month]),ALLEXCEPT(DIM_Calendar,DIM_Calendar[Year]))
 
The year is coming from another table: 
 
 
 

@Anonymous ,

Both fields are in numeric form(Whole number). You didn't mention about the Year is coming from different table. FOr this make a proper relationship betweeb those table.

 

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Thanks I changed to a whole number and it worked !

Great @Anonymous !

 

I will really appreciate your KUDOS/Thumbs up! 😊

Good Luck!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors