Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Bakhtawar
Post Patron
Post Patron

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bakhtawar ,

 

Formula for measure.

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

 1.PNG

Formula for calculated column.

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

2.PNG

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

3.PNG4.PNG

 

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.

View solution in original post

14 REPLIES 14
Anonymous
Not applicable

Hi @Bakhtawar ,

 

Formula for measure.

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

 1.PNG

Formula for calculated column.

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

2.PNG

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

3.PNG4.PNG

 

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.

az38
Community Champion
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

  


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

i tried but

POLICY_EFFECTIVE_DATE

is not display in list

 

Untitled.png

az38
Community Champion
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

  


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

yes i have these columns in table

Untitled.png

az38
Community Champion
Community Champion

@Bakhtawar 

in what table are you trying to create a column? if in the same you should see it in drop-down list

 

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


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

see my table name is memeber but i did not get in list

 

Untitled.png

az38
Community Champion
Community Champion

@Bakhtawar 

it looks like you create a measure not column. measure could not have a direct relate to column, it should be some calculations

 

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


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

yes i am trying to create measure ..

 

this expression is in qliksesne .. so i want to rewrite in dax

 

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

az38
Community Champion
Community Champion

@Bakhtawar 

try to create new COLUMN as I mentioned before or descibe your further logic if you need measure

 

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


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

i already desfribe my logic is that if both dates are equal then show age_band otherwise null @az38
az38
Community Champion
Community Champion

@Anonymous thx.

@Bakhtawar  highly recommend to read this https://docs.microsoft.com/en-us/power-bi/guidance/dax-column-measure-references

 

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


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Go to home Tab

Click on NEw Column

 

Column= If(table[First_date]=table[Second_Date],[Age-band],blank())

 

Note: replace first_date and second_date with required date columns.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

this same table but i did not get field names ...even table does not appear ... what should i do

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors