cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xRTP
Helper III
Helper III

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!

xRTP_0-1654436930682.png

 

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @xRTP ,

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

yingyinr_0-1657087362341.png

Best Regards

Community Support Team _ Rena
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

10 REPLIES 10
yingyinr
Community Support
Community Support

Hi @xRTP ,

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

yingyinr_0-1657087362341.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tamerj1
Super User
Super User

Hi @xRTP 

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
    )

Hello,

 

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

xRTP_0-1654498757517.png

 

@xRTP 

Please clarify with example 

Hello,
Here it counts how many recent so it returns 1 value. The thing is I want to count rows of request ID that has the most recent date, It should return 10 value since there are 10 RequestID that was dated on June 2 (which is recent ATM) so i tried using this code but in visualizer it says it coudnt load the data for this visual

 

OMNew Volume =
VAR FirstDateEver =
CALCULATE ( MIN ( 'CA Omega'[Request Release Date] ), REMOVEFILTERS () )
RETURN
CALCULATE (
COUNTROWS( 'CA Omega'),'CA Omega'[Request ID],
'CA Omega'[Request Release Date] = FirstDateEver
)

xRTP_1-1654503334274.png

 

xRTP_0-1654503083910.png

 

@xRTP 
Would you please RETURN FirstDateEver variable and see the results?

Yah already did but it still count 1 value

@xRTP 
Maybe you have a blank date somewhere, Please try

OMNew Volume =
VAR FirstDateEver =
    CALCULATE (
        MIN ( 'CA Omega'[Request Release Date] ),
        REMOVEFILTERS (),
        'CA Omega'[Request Release Date] <> BLANK ()
    )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'CA Omega'[Request ID] ),
        'CA Omega'[Request Release Date] = FirstDateEver,
        REMOVEFILTERS ()
    )

@xRTP 
Please try

OMNew Volume =
VAR FirstDateEver =
    CALCULATE ( MIN ( 'CA Omega'[Request Release Date] ), REMOVEFILTERS () )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'CA Omega'[Request ID] ),
        'CA Omega'[Request Release Date] = FirstDateEver,
        REMOVEFILTERS ()
    )

Hello, It still returns 1 value 😞 

xRTP_0-1654505868121.png

 

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 25

Ted's Dev Camp - August 25, 2022

Watch Session 25 of Ted's Dev Camp.

Top Solution Authors