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! Request now

Reply
Patricio479
Frequent Visitor

Select an specific value from a filtered table

Hello, dear PBI experts.

 

I have a table that contains data related to "Division", "Date" and "Number". I have created two slicers to filter by Division and Date. After these filters are applied I would like to show in a card the value related to the latest date. Could you kindly advise how to achieve this? 

In the example below, I've filtered "A" until 20/13/2023 and I would like to show 0.87 as a result... and If I filter "A" until 11/04/2023, I would like to show 0.92... you get the idea, right?

Capture PowerBI question.PNG

Thanks for your help!
Pat.

2 ACCEPTED SOLUTIONS
sergej_og
Super User
Super User

Hey @Patricio479 ,
if this is your target result:

sergej_og_0-1693693822389.pngsergej_og_1-1693693844037.png

you can try to apply this formula into your model. Should work for your described purpose.

MAX Value = 
    CALCULATE(
        MAX(yout_table[Number]),
        'Calendar'[Date] = MAX(your_table[Date])
        )


Regards

View solution in original post

parry2k
Super User
Super User

@Patricio479 Ok, let's test it, if it doesn't work then I will recreate dataset on my end to test it:

 

Measure = 
CALCULATE (
    MAX ( Table[Number] ),
    INDEX (
        1, 
        SUMMARIZE ( ALLSELECTED ( Table ), Table[Date], Table[Division] ),
        ORDERBY ( Table[Date], DESC ),
        PARTITIONBY ( Table[Division] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

12 REPLIES 12
parry2k
Super User
Super User

@Patricio479 Ok, let's test it, if it doesn't work then I will recreate dataset on my end to test it:

 

Measure = 
CALCULATE (
    MAX ( Table[Number] ),
    INDEX (
        1, 
        SUMMARIZE ( ALLSELECTED ( Table ), Table[Date], Table[Division] ),
        ORDERBY ( Table[Date], DESC ),
        PARTITIONBY ( Table[Division] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello Parry2k,

Your solution has worked!
Thanks for your time, your help was much appreciatted!


Cheers,
Pat.

parry2k
Super User
Super User

Add one more line after partitionby 

 

,MATCHBY(Table[Division])



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello Parry2k,

I still get an error. This time:

Patricio479_0-1693759112168.png

This is still showing an error in the "partitionby" line.
Thanks for your help,

Pat.

Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.


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

Hello Ashish!
Thanks for your message. Hope this helps:

 

DivisionDateNumber
A15/01/20230,82
B15/01/20230,94
C15/01/20230,88
D15/01/20230,86
A25/02/20230,98
B25/02/20231,14
C25/02/20230,98
D25/02/20231,15
A20/03/20230,87
B20/03/20231,52
C20/03/20231,07
D20/03/20231,60
A11/04/20230,92
B11/04/20231,52
C11/04/20231,07
D11/04/20231,60

 

Thanks!

Pat.

parry2k
Super User
Super User

@Patricio479 you can use the new INDEX function to get it:

 

Max Number = 
CALCULATE ( 
   MAX ( Table[Number] ),
   INDEX (
      1,
      ALLSELECTED ( Table ),
      ORDERBY ( Table[Date], DESC ),
      PARTITIONBY ( Table[Division )
   )
)

 

Advantage here is if you have multiple Division selected and you view it by Divison you will max value of each division. Killing 2 birds with one stone.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello Parry2k,

Thanks for your fast reply. I tried to input your formula, but I am getting the following error:

Patricio479_0-1693747034527.png

Thanks for your help once more!

Pat.

 

sergej_og
Super User
Super User

Hey @Patricio479 ,
if this is your target result:

sergej_og_0-1693693822389.pngsergej_og_1-1693693844037.png

you can try to apply this formula into your model. Should work for your described purpose.

MAX Value = 
    CALCULATE(
        MAX(yout_table[Number]),
        'Calendar'[Date] = MAX(your_table[Date])
        )


Regards

Hello Sergej!

Thanks for your help! The suggested formula worked for the intended purpose.

 

Have a good one!

Pat.

parry2k
Super User
Super User

@Patricio479 will you always select one division, what happens if two divisions are selected or that is never going to be the case?

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello Parry2k,

 

I think that - for the time being - I will just constrain the filter to work for just one division (single selection). Is it simplier this way? 🙂
A multiselection might come in the future...if that is the case, I will open another post when the time comes...

 

Thanks!

 

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