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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
UsePowerBI
Post Prodigy
Post Prodigy

How can I get the the corresponding value to the maximum date?

Hello

 

I have the data:

A, 01/01/20, X1

A, 02/01/20, X2

A, 01/01/20, X3

A, 02/01/20, X4

B, 01/01/20, X5

B, 02/01/20, X6

B, 01/01/20, X7

...

 

I want to get the X value which corresponds to the maximum date for each of the A and B.

 

Any idea please?

1 ACCEPTED SOLUTION

Hi @UsePowerBI ,

 

Here the sample data:

Capture.PNG

 

Then you can use the following measure:

 

Measure = VAR A = CALCULATE(MAX('Table'[Column2]),ALLEXCEPT('Table','Table'[Column1])) RETURN CALCULATE(CONCATENATEX('Table','Table'[Column3],","),'Table'[Column2] =A)

 

Capture1.PNG

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@UsePowerBI , Try a measure like

calculate(sum(Table[col 3]), filter(Table, Table[Date] = calculate(max(Table[date]), allexcept(Table, Table[col 1]))))

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

@amitchandak  I cannot make any sense of what you wrote, can you explain step by step please?

Hi @UsePowerBI ,

 

Here the sample data:

Capture.PNG

 

Then you can use the following measure:

 

Measure = VAR A = CALCULATE(MAX('Table'[Column2]),ALLEXCEPT('Table','Table'[Column1])) RETURN CALCULATE(CONCATENATEX('Table','Table'[Column3],","),'Table'[Column2] =A)

 

Capture1.PNG

 

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

 

Best Regards,

Dedmon Dai

@UsePowerBI , I do not see any column name,

So the columns are col1, date, col3

 

so you can try max of col3 on max of date on allexpect col 1

calculate(maxTable[col 3]), filter(Table, Table[Date] = calculate(max(Table[date]), allexcept(Table, Table[col 1]))))

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

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!

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.