The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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!
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.
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. 🙂
User | Count |
---|---|
80 | |
74 | |
41 | |
30 | |
28 |
User | Count |
---|---|
107 | |
96 | |
53 | |
47 | |
47 |