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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Tricx
New Member

Return max monthly sales value

Can you help me with measure which return maximum monthly sales value

Table Sales contains sales values for every day in 2022

Date Sales
1/1/2022

 

2000

1/2/2022 3000
1/3/2022 1000
....  

30/12/2022

 5000

31/12/2022

 1000

 

and result will be month which have max (highest) sales in the month e.g.

Month Sales
Jun2022 150000

 

Thank you

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Tricx , you can use TOPN

 

Maxx(TOPN(1, allselecetd(table[Month]), calculate(sum(Table[Sales])) , desc) , [Month])

 

 

Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Tricx
New Member

Thank you! with small modifications it works as expected.
I really appreciate the quick response.
 
Maxx(TOPN(1, GROUPBY('TableMonth','TableMonth'[Month]), 'Table'[Sales], desc),'Table'[Sales])

View solution in original post

2 REPLIES 2
Tricx
New Member

Thank you! with small modifications it works as expected.
I really appreciate the quick response.
 
Maxx(TOPN(1, GROUPBY('TableMonth','TableMonth'[Month]), 'Table'[Sales], desc),'Table'[Sales])
amitchandak
Super User
Super User

@Tricx , you can use TOPN

 

Maxx(TOPN(1, allselecetd(table[Month]), calculate(sum(Table[Sales])) , desc) , [Month])

 

 

Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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