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
Mediviz
Frequent Visitor

select the last value saved by item

Hi everyone

Below I have a table with dates and scores by name.

 

NomDateScore
AAA01.01.2021  1540
AAA02.01.2021   1640
AAA03.01.2021   1753
AAA04.01.2021        1840
AAA05.01.2021    1940
AAA06.01.2021   2040
AAA07.01.2021870
BBB01.01.2021875
BBB02.01.2021698
BBB03.01.2021566
BBB04.01.2021641
BBB05.01.2021255
CCC01.01.2021120
CCC02.01.2021218
CCC03.01.202155

 

I need to display only the last score recorded by name.

 

NomDateScore
AAA07.01.2021    870
BBB05.01.2021    255
CCC03.01.2021   55


Thanks for your help

2 ACCEPTED SOLUTIONS
ERD
Super User
Super User

Hi @Mediviz ,

You can try this measure:

 

MaxValuePerNom = 
VAR currNom = SELECTEDVALUE ( T[Nom] )
VAR maxDate = MAXX ( FILTER ( ALL ( T ), T[Nom] = currNom ), T[Date] )
RETURN
    IF (
        SELECTEDVALUE ( T[Date] ) = maxDate,
        CALCULATE ( MAX ( T[Score] ), T[Nom] = currNom, Table15[Date] = maxDate )
    )

ERD_0-1624947316305.png

 

 

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

Icey
Community Support
Community Support

Hi @Mediviz ,

 

Try this:

Measure filter =
VAR LastDate_ =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Nom] ) )
RETURN
    IF ( MAX ( 'Table'[Date] ) = LastDate_, 1 )

measure filter.PNG

 

 

Best Regards,

Icey

 

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

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Mediviz ,

 

Try this:

Measure filter =
VAR LastDate_ =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Nom] ) )
RETURN
    IF ( MAX ( 'Table'[Date] ) = LastDate_, 1 )

measure filter.PNG

 

 

Best Regards,

Icey

 

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

ERD
Super User
Super User

Hi @Mediviz ,

You can try this measure:

 

MaxValuePerNom = 
VAR currNom = SELECTEDVALUE ( T[Nom] )
VAR maxDate = MAXX ( FILTER ( ALL ( T ), T[Nom] = currNom ), T[Date] )
RETURN
    IF (
        SELECTEDVALUE ( T[Date] ) = maxDate,
        CALCULATE ( MAX ( T[Score] ), T[Nom] = currNom, Table15[Date] = maxDate )
    )

ERD_0-1624947316305.png

 

 

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

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

amitchandak
Super User
Super User

@Mediviz , Try a measure like


Measure =
VAR __id = MAX ('Table'[Nom] )
VAR __date = CALCULATE ( max('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[Nom] = __id )
CALCULATE ( Sum ('Table'[Score] ), VALUES ('Table'[Nom] ),'Table'[Nom] = __id,'Table'[Date] = __date )

 

if need take amx for dat

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.