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.
Hello,
Using the following formula (adding calculated column to my date table) which I thought should work, but getting an error message. If I just put Blank() ) the syntax does not show me any error message when writing the formula, but as soon as I hit enter, it adds all of these )))))) with the last one showing the dreaded red squiggly line and then this error message.
Any ideas why? Am I perhaps missing something after the Blank() ?
Solved! Go to Solution.
I answered my own question.
Did not need to put "DATE" in front. And did not need parenthesis.
Hello @Anonymous
DATE() function returns a date and will require these numeric inputs: Year, Month, Day. You may use the simplied formula below:
Weekend or Weekday =
IF (
DataTable[DayInWeek] = 0
|| DataTable[DayInWeek] = 6,
"Weekend",
"Weekday"
)
Or use a longer one:
Weekend or Weekday =
SWITCH (
TRUE (),
DataTable[DayInWeek] = 1, "Weekday",
DataTable[DayInWeek] = 2, "Weekday",
DataTable[DayInWeek] = 3, "Weekday",
DataTable[DayInWeek] = 4, "Weekday",
DataTable[DayInWeek] = 5, "Weekday",
DataTable[DayInWeek] = 6, "Weekday",
DataTable[DayInWeek] = 0, "Weekday"
)
Proud to be a Super User!
@Anonymous , DATE() is a function that returns a date when you supply a year, month, and day.
DATE(2020, 2, 14) returns February 14, 2020, formatted as a date.
This calculated column will give you what you're looking for:
Weekend or Weekday =
IF(
DateTable[DayInWeek] = 0
|| DateTable[DayInWeek] = 6
,"Weekend"
,"Weekday"
)
You didn't close the parentheses on all those DATE( formulas. Should be DATE(DateTable[DayInWeek]).
Proud to be a Super User!
I answered my own question.
Did not need to put "DATE" in front. And did not need parenthesis.
Oh right, I think you want DAY, not DATE.
Proud to be a Super User!
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |