Forum Discussion

DemandMGR's avatar
DemandMGR
Helper I
4 years ago
Solved

Custom Column or Dax Formula

I am tying to write a Dax Formula or a Custom Column, preferrably a custom column.

 

I want the formula to reference two Date columns. The two columns are ETADATE and APPTDATE. My goal is to idenitfy all the ETADATEs that are Today+ 3 days that do not have a APPTDATE, which shows up in the APPTDATE column as 1/1/2001.

 

The Today+3days would have to be rolling over every day. I can also change the 1/1/2001 No APPT indicator to anything else so if that doesnt work I would be happy to replace that value with something else.

 

Please let me know if you need more information but I would greatly appreciate some assistance with this. Thank you for reading

  • DemandMGR , Small correction on what @ryan has suggested. Please create a new custom column with below code:-

     

    column  = IF (
        ETADATE = TODAY ()
            || ETADATE
                = TODAY () + 1
            || ETADATE
                = TODAY () + 2,
        "PO#",
        "NO"
    )

     

    Thanks,

    Samarth

     

7 Replies

  • Hi DemandMGR 

     

    Can you post sample data as text and expected output?
    Not enough information to go on;

    please see this post regarding How to Get Your Question Answered Quickly:
    https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.
    4. Relation between your tables

    Appreciate your Kudos!!
    LinkedIn:www.linkedin.com/in/vahid-dm/

    • DemandMGR's avatar
      DemandMGR
      Helper I

      What I am looking for is something like an IF(OR) fucntion from excel. Please see example below.

       

      IF(OR(ETADATE=TODAY(),ETADATE=TODAY()+1,ETADATE=TODAY()+2),"PO#","NO")

       

      Honestly I think I can figure out the rest from there. I am not even sure if this is possible but I am hoping it is

       

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        DemandMGR 

        pls try this

        IF(ETADATE=TODAY() || ETADATE=TODAY()+1 || ETADATE=TODAY()+2),"PO#","NO")