Forum Discussion

howcreech's avatar
howcreech
Regular Visitor
1 year ago
Solved

Date Measure if blank

Hi,

 

What I want to create is a measure that looks for a date in a named column, if it is blank to run edate(today(),2) if it contains a date return the existing date. I used a similar measure on some work I did a year ago, but it was looking at if it was blank first, I've tried to rearrange and nothing seems to work. 

 

Target End Date = if(sum('Support Request'[EndDate])<>"",edate(today(),2),"")
 
Thank you in advance for any help.
  • Hi Everyone,

    I used some of the information provided and used an internal AI system to find the below DAX operation that worked:

     

    Target End Date 2 =
    IF(
        not(isblank(selectedvalue('Support Request'[Completed]))),
        selectedvalue('Support Request'[Completed]),
        edate(today(),2))
     
    Thank you everyone for the help. 

6 Replies

  • Try

    Target End Date =
    SELECTEDVALUE ( 'Support Request'[EndDate], EDATE ( TODAY (), 2 ) )
    
    • howcreech's avatar
      howcreech
      Regular Visitor

      Hi johnt75,

      that removed the blank items from the report instead of filling in a date 2 months from today. Sorry if my question is not complete, I am still working as a new user of Power BI and struggle with many of the topics. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi howcreech ,
    You can try the following code

    Target End Date = 
    IF(
        ISBLANK(SUM('Support Request'[EndDate])),
        EDATE(TODAY(), 2),
        SUM('Support Request'[EndDate])
    )

     

    Best regards,
    Albert He


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

    • howcreech's avatar
      howcreech
      Regular Visitor

      Hi Albert He,

      I tried your solution, but it didn't work either. However, I have tried a combination or yours and johnt75 to get a partial result. What I am struggling with now is that the formula is overwriting the data that exists in some instances. Below is the formula I input:

      Target End Date =
      IF(
          isblank(selectedvalue('Support Request'[EndDate])),
          EDATE(TODAY(),2),
          selectedvalue('Support Request'[EndDate]))
       
      I'm not sure what is happening to the list data, but I know the EndDate was the previous name the column had (it currently has the name Target End Date). With this formula I'm hoping to leave the date if it currently exists, if not run the edate formula to add on two months. 
  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi howcreech 

    We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

    If our response was helpful, please mark it as the accepted solution and give a kudos, as this helps other members in  community.

    Thank You!

  • howcreech's avatar
    howcreech
    Regular Visitor

    Hi Everyone,

    I used some of the information provided and used an internal AI system to find the below DAX operation that worked:

     

    Target End Date 2 =
    IF(
        not(isblank(selectedvalue('Support Request'[Completed]))),
        selectedvalue('Support Request'[Completed]),
        edate(today(),2))
     
    Thank you everyone for the help.