Forum Discussion
Jkrupski
1 year agoRegular Visitor
Check if a date column is between 2 hard coded dates
Hello, I am very new to power bi and dax, learning as I go. I am trying to use an if statement that checks a date added column and compares it to 2 hard coded dates, if it is between the date...
- 1 year ago
Jkrupski Try:
columnTest = VAR dateAdded = [column] VAR P3Start = DATE(2025,3,29) VAR P3End = DATE(2025,3,29) RETURN If(dateAdded <= P3End && dateAdded >= P3Start, "P3", "NA")FORMAT turns dates into text and that is not a good way to compare dates.
Greg_Deckler
1 year agoCommunity Champion
Jkrupski Try:
columnTest =
VAR dateAdded = [column]
VAR P3Start = DATE(2025,3,29)
VAR P3End = DATE(2025,3,29)
RETURN
If(dateAdded <= P3End && dateAdded >= P3Start, "P3",
"NA")
FORMAT turns dates into text and that is not a good way to compare dates.