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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
darshaningale
Resolver II
Resolver II

How to take highest value of text column in subtotals in matrix.

I have the below data.

Order ProductOrder Date
1P19-Oct
1P210-Oct
1P38-Oct
2P49-Oct
2P58-Oct

 

I want to show the Product which is present in the row where the date is latest.

 

Result

Order ProductOrder Date
1P210-Oct
2P49-Oct

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

 Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

 Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you @Ashish_Mathur ..the solution works fine..

We have to make one measure for farthest date.

and another one for the product column to select the product of the farthest date.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur the link doesnt work for me.

Hi,

It works just fine.  Please try agin.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur i got it now..seems to be a VPN problem at my side..I need to install the latest version of PBI..so it will be a while I will get back to you.

pranit828
Community Champion
Community Champion

Hi @darshaningale 

Create a column

_Selected =IF('table'[Order Date] =  CALCULATE(MAX('table'[Order Date]), ALLEXCEPT('table','table'[Order])),1,0)

 

And while displying the result filter the result on _selected to have 1.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@pranit828 we do not want to filter any data here..we just want to consider latest value of order date and show that product in subtotals.

HI @darshaningale 

The code will do as mentioned in the intial ask you have posted.

Maybe elaborate your ask more to get the exact solution.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
VijayP
Super User
Super User

@darshaningale 

Your question is not clear

in case of P1 also of 9 oct then how to categorise only P4 as 9 Oct. any logic behind it?




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@VijayP I have listed only the date part here..the actual data contains time part also.

if we have same timestamp , it should take alphanumeric ascending order of Product column.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.