Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Filter a blank from a column

Hi All,
 
I am trying to filter a column of dates from the blank rows.
This is my DAX but it doesnt work. 

ColumnName =
VAR _test =
Contracten[Verwachte datum contract km bereikt] <> BLANK()

RETURN

IF (
DATEDIFF ( UTCTODAY (); _test; MONTH ) <= 4;
"EindContractKM ";
BLANK ()
)
 
Thank you

6 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    your _test variable returns BOOLEAN what that cannot be used as second argument in DATEDIFF()

    what value do you need there?

    whats your desired result for row with Contracten[Verwachte datum contract km bereikt] <> BLANK() ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI az38 I would try the value (date) of the rows except the blank rows of  Contracten[Verwachte datum contract km bereikt] 

       

      Regards,
      Ezz 

      • az38's avatar
        az38
        Community Champion

        Anonymous 

        maybe it will be enough to try a simple version of yours statement? Like

        ColumnName =
        IF( 
        Contracten[Verwachte datum contract km bereikt] <> BLANK() 
        && DATEDIFF ( UTCTODAY (); Contracten[Verwachte datum contract km bereikt]; MONTH ) <= 4;
        "EindContractKM ";
        BLANK ()
        )

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi edhans, I tried this already and didnt get the right result