cancel
Showing results for
Did you mean:
New Member

## select the last value saved by item

Hi everyone

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

 Nom Date Score AAA 01.01.2021 1540 AAA 02.01.2021 1640 AAA 03.01.2021 1753 AAA 04.01.2021 1840 AAA 05.01.2021 1940 AAA 06.01.2021 2040 AAA 07.01.2021 870 BBB 01.01.2021 875 BBB 02.01.2021 698 BBB 03.01.2021 566 BBB 04.01.2021 641 BBB 05.01.2021 255 CCC 01.01.2021 120 CCC 02.01.2021 218 CCC 03.01.2021 55

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

 Nom Date Score AAA 07.01.2021 870 BBB 05.01.2021 255 CCC 03.01.2021 55

2 ACCEPTED SOLUTIONS
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 )
)``````

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

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 )
``````

Best Regards,

Icey

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

3 REPLIES 3
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 )
``````

Best Regards,

Icey

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

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 )
)``````

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

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

Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Announcements

#### 2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.