Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filter most recent date

Hello, 
Ive been using dax, i would like to filter the newest date for Request Release Date Column on CA Omega Table. Do i need to add a new column to get my data or just a new measure? Plus why i cant put my column name after EARLIEST(). Advance thank you to your inputs!

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    You can create a measure as below, please find the details in the attachment.

    OMNew Volume = 
    VAR _recentdate =
        CALCULATE (
            MAX ( 'CA Omega'[Request Release Date] ),
            ALLSELECTED ( 'CA Omega' )
        )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( 'CA Omega'[Request ID] ),
            FILTER (
                ALLSELECTED ( 'CA Omega' ),
                'CA Omega'[Request Release Date] = _recentdate
            )
        )

    Best Regards

10 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 

    please try

    OMNew Volume =
    VAR FirstDateEver =
        CALCULATE ( MIN ( 'CA Omega'[Request Release Date] ), REMOVEFILTERS () )
    RETURN
        CALCULATE (
            COUNT ( 'CA Omega'[Request ID] ),
            'CA Omega'[Request Release Date] = FirstDateEver
        )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      This works! thanks. But is it possible to count rows all entrys with the most recent date? It only return 1 transaction

       

      • tamerj1's avatar
        tamerj1
        Community Champion

        Anonymous 

        Please clarify with example 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can create a measure as below, please find the details in the attachment.

    OMNew Volume = 
    VAR _recentdate =
        CALCULATE (
            MAX ( 'CA Omega'[Request Release Date] ),
            ALLSELECTED ( 'CA Omega' )
        )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( 'CA Omega'[Request ID] ),
            FILTER (
                ALLSELECTED ( 'CA Omega' ),
                'CA Omega'[Request Release Date] = _recentdate
            )
        )

    Best Regards