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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bluetronics
Helper III
Helper III

Max by products and year

Hello,

I want to get the max value by produts and year from the table below:

a.gif

I can get Max value of products and date when I use quick measures like below:

b.gif it shows Max of every single data.

But I would like to see the result the max of products by year like the table below:

c.gif

Can I get the support how I can get the result what I want to get?

Thanks in advance.

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @bluetronics  ,

Here are the steps you can follow:

1. Create calculated column.

Year = YEAR('Table'[Date])
sum =
CALCULATE(SUM('Table'[Qty]),FILTER(ALL('Table'),'Table'[Product]=EARLIER('Table'[Product])&&'Table'[Year]=EARLIER('Table'[Year])))

2. Create calculated table.

Table 2 = SUMMARIZE('Table','Table'[Product],"Max",CALCULATE(MAX('Table'[sum]),FILTER('Table','Table'[Year]='Table'[Year])))

3. Result.

v-yangliu-msft_0-1606981357729.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @bluetronics  ,

Here are the steps you can follow:

1. Create calculated column.

Year = YEAR('Table'[Date])
sum =
CALCULATE(SUM('Table'[Qty]),FILTER(ALL('Table'),'Table'[Product]=EARLIER('Table'[Product])&&'Table'[Year]=EARLIER('Table'[Year])))

2. Create calculated table.

Table 2 = SUMMARIZE('Table','Table'[Product],"Max",CALCULATE(MAX('Table'[sum]),FILTER('Table','Table'[Year]='Table'[Year])))

3. Result.

v-yangliu-msft_0-1606981357729.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a lot! it's very clear and works well. 👍

amitchandak
Super User
Super User

@bluetronics , I do not see 15 for A, It can be that last value for A

 

Try a formula like

calculate(max(Table[Qty]), filter(Table, Table[Date] = calculate(max(Table[Date]), allexcept(Table, Table[Product]))))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Pls. see the result  and it does not work properly.  thereis an error on a formula.

a.gif

I tried but I don't think it works. 😞

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.