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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marksappleton
Frequent Visitor

Need help: Date indicator column

Hello,

 

I am a beginner with Dax and I am trying to accept two columns ("Date" and "Reported Date") and each columns contains a date formatted date value.

 

I am looking to create a calculated column or measure to be used as a dynamic indicator when the dates are the same on the same row.

 

Example:

 

Date                     Reported Date     New column

01/08/2018           02/08/2018                    0

02/08/2018           02/08/2018                    1

03/08/2018           02/08/2018                    0

 

The idea is that if both dates are the same on the same row, the column should show 1 else 0.  This way I am then able to filter on the 1 dynamically in the filters.

 

Many thanks for your replies.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello.

 

You could simply add new column then type this in the formula bar:

 

New Column = IF( TableName[Date] = TableName[Reported Date], 1, 0)

Hope this helps!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hello.

 

You could simply add new column then type this in the formula bar:

 

New Column = IF( TableName[Date] = TableName[Reported Date], 1, 0)

Hope this helps!

Further to my other comments, given there are two tables, does it matter what table the column is created in?

Thanks for your reply.

 

I did do this but it the dates are in different tables and also when I go to enter one of the dates in the other table, the auto options when typing don't contain that field to select.  I have setup the two tables with a relationship back to a dimdate table.

 

I've tried a lot of things but cannot get it working properly.

Anonymous
Not applicable

Oh! You forgot to mention that the dates are from two tables. You need to create a relationship between the two tables. It would be better if you could share your data or maybe a sample of your data in different tables.

Many thanks for your replies.  I managed to sort it out myself in the end. 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.