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.
my problem is that I've two column
column 1 and column 2
they are date dd/mm/yyyy
I need to say that the row in column 1 are in a month before than the row in column 2 ( could be 2 or more month of difference) ture false
I need to find a way to make give result so in 12/2017 is before than 01/2018
Solved! Go to Solution.
If you are not care about the time interval between column1 and column2, and just want to mark two days from different months, you can use the following DAX.
Column = IF(DATEDIFF(MIN(TimeDiff[Column1],TimeDiff[Column2]),MAX(TimeDiff[Column1],TimeDiff[Column2]),MONTH)>=1,TRUE())
MIN and MAX function is just used for in case you have any date in Column 1 is early than the corresponding one in Column 2.
Regarding for "one month before", are you saying the date in column 2 should be at least 30 days older than the one in column 1? If this is the case, you can refer to the following DAX to get the rough result.
MoreThan1M = IF(DATEDIFF(TimeDiff[Column1],TimeDiff[Column2],DAY)>=30&&DATEDIFF(TimeDiff[Column1],TimeDiff[Column2],MONTH)>=1,TRUE())
for example in case of 29 march and 1 april, this is a different month, it will work rules of more than 30 days?
If you are not care about the time interval between column1 and column2, and just want to mark two days from different months, you can use the following DAX.
Column = IF(DATEDIFF(MIN(TimeDiff[Column1],TimeDiff[Column2]),MAX(TimeDiff[Column1],TimeDiff[Column2]),MONTH)>=1,TRUE())
MIN and MAX function is just used for in case you have any date in Column 1 is early than the corresponding one in Column 2.
Hi @snifer,
Do you want to check whether the date in column1 is one month before that in column2? If yes, return true, otherwise return false.
You can add a calculated column like this:
check difference = IF(DATEDIFF(Table1[Column1],Table1[Column2],MONTH)=1,TRUE(),FALSE())
Best regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |