Forum Discussion

Bakhtawar's avatar
Bakhtawar
Post Patron
6 years ago
Solved

dates equal in dax

I have two dates Effec_Date and bene_Date .. i want to euqlas to both dates and want like

 

if these two both dates are equal then age_band , otherwise null .. like this

 

=IF(POLICY_EFFECTIVE_DATE=BENEFICIARY_START_DATE,AGE_BAND,Null())

i want to rewrite this in DAX..

any idea

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Bakhtawar ,

     

    Formula for measure.

    Measure = IF(SELECTEDVALUE('Table'[Effec_Date])=SELECTEDVALUE('Table'[bene_Date]),SELECTEDVALUE('Table'[age_band]),BLANK())

     

    Formula for calculated column.

    Column = IF('Table'[Effec_Date]='Table'[bene_Date],'Table'[age_band],BLANK())

    To create Measures or Calculated columns, please right click on cloumns or tables or find menus under Modeling.

     

    Best Regards,

    Jay

    Community Support Team _ Jay Wang

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

14 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Bakhtawar 

    try simple IF

    Column = 
    IF([POLICY_EFFECTIVE_DATE]=[BENEFICIARY_START_DATE],
    [AGE_BAND],
    BLANK())

     

    do not hesitate to give a kudo to useful posts and mark solutions as solution

      

    • Bakhtawar's avatar
      Bakhtawar
      Post Patron

      i tried but

      POLICY_EFFECTIVE_DATE

      is not display in list

       

      • az38's avatar
        az38
        Community Champion

        Bakhtawar 

        do you have such column? how does your data model look like?

        Column = 
        IF('TableName'[POLICY_EFFECTIVE_DATE]='TableName'[BENEFICIARY_START_DATE],
        'TableName'[AGE_BAND],
        BLANK())

         

        do not hesitate to give a kudo to useful posts and mark solutions as solution

          

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Bakhtawar ,

     

    Formula for measure.

    Measure = IF(SELECTEDVALUE('Table'[Effec_Date])=SELECTEDVALUE('Table'[bene_Date]),SELECTEDVALUE('Table'[age_band]),BLANK())

     

    Formula for calculated column.

    Column = IF('Table'[Effec_Date]='Table'[bene_Date],'Table'[age_band],BLANK())

    To create Measures or Calculated columns, please right click on cloumns or tables or find menus under Modeling.

     

    Best Regards,

    Jay

    Community Support Team _ Jay Wang

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