Forum Discussion

deng2431's avatar
deng2431
Icon for Helper I rankHelper I
3 years ago
Solved

DAX - Filtering blank if same key with reference to another column is blank

Hi DAX team,   I am having filtering concept that's scratching.  i want to show null or blank if the same [key] is used with reference to the [Payment Date] that is blank, currently it's showing t...
  • v-jianboli-msft's avatar
    3 years ago

    Hi deng2431 ,

     

    Please try:

    Payment date(Final) = 
    VAR _a =
        CALCULATE (
            MAX ( 'Table'[Payment Date] ),
            FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) )
        )
    VAR _b =
        SELECTCOLUMNS (
            FILTER ( 'Table', [Key] = EARLIER ( 'Table'[Key] ) ),
            "Payment Date", [Payment Date]
        )
    RETURN
        IF ( BLANK () IN _b, BLANK (), _a )

    Final output:

     

    Best Regards,

    Jianbo Li

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