Forum Discussion

daxnoob's avatar
daxnoob
Frequent Visitor
3 years ago
Solved

Include the min Date in Summarize

Hi, Is it possible to include the distinct min date value in a summarize measure?

Here is my code:

Countx(
         Summarize(
                 'Table',
                 'Table'[Name],

                 min('Table'[Date]),
                 'Table'[Age]),
         [Measure]
)

Obviously, this won't work but the table is set up where there can be multiple dates for each distinct name and I'm only trying to group each column with the minimum date value. Is that possible?

Thank you.

  • Is this what you are looking for?

     

     

    Countx( FILTER(
             Summarize(
                     'Table',
                     'Table'[Name],
                     'Table'[Date])
                     'Table'[Age]),'Table'[Date]=min('Table'[Date])),
             [Measure]
    )
    ----------
    or
    Countx( FILTER(
             Summarize(
                     'Table',
                     'Table'[Name],
                     'Table'[Date])
                     'Table'[Age]),'Table'[Date]=STARTOFMONTH('Table'[Date],0)),
             [Measure]
    )

     

     

2 Replies

  • Is this what you are looking for?

     

     

    Countx( FILTER(
             Summarize(
                     'Table',
                     'Table'[Name],
                     'Table'[Date])
                     'Table'[Age]),'Table'[Date]=min('Table'[Date])),
             [Measure]
    )
    ----------
    or
    Countx( FILTER(
             Summarize(
                     'Table',
                     'Table'[Name],
                     'Table'[Date])
                     'Table'[Age]),'Table'[Date]=STARTOFMONTH('Table'[Date],0)),
             [Measure]
    )