Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago
Solved

Maximum Name according to date

Hello everyone good afternoon

I have the following case :

DateNumberID
01-01-2023

AAEE

1
07-05-2023OOII1
12-12-2023PPSS1

I would like to bring either in a table or column the name according to the maximum date per ID

in this case the expected result is PPSS, since it has the highest date of ID 1

Stay tuned for any questions

Best regards

  • Hi Syndicate_Admin ,

    If I understand you correctly, please try this.

     

    Name / Latest date = 
    
    var _id = MAX(HighName[ID])
    
    var _calc = CALCULATE(MAX(HighName[Number]), FILTER(ALL(HighName), HighName[ID]=_id && HighName[Date] = MAX(HighName[Date])))
    
    return _calc





    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel

     

     

4 Replies

  • Hello

    Thanks a lot

    It works perfect as a measure, it's just to know

    I only have one question, is there any way to leave it as a column or table??? , I did it as a column and it only returns blank values

    • Nathaniel_C's avatar
      Nathaniel_C
      Icon for Community Champion rankCommunity Champion

      Hi PVVB100, Syndicate_Admin ,

      Here it is as a column:


      Let me know if you have any questions.

      If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
      Nathaniel

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi Syndicate_Admin ,

    If I understand you correctly, please try this.

     

    Name / Latest date = 
    
    var _id = MAX(HighName[ID])
    
    var _calc = CALCULATE(MAX(HighName[Number]), FILTER(ALL(HighName), HighName[ID]=_id && HighName[Date] = MAX(HighName[Date])))
    
    return _calc





    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel