Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi, I'm trying to add a column with a condition in it, here's the code:
if(
(Time.Hour([Date and hour]) < 22 and Time.Hour([Date and hour]) > 😎
then "Day"
else "Night")
But everything im getting is an error saying expecting token RightParen, what am I doing wrong? The problem seems to appear with 'then' operator.
Solved! Go to Solution.
if Time.Hour([Date and hour]) < 22 and Time.Hour([Date and hour]) > 8
then "Day"
else "Night"
if Time.Hour([Date and hour]) < 22 and Time.Hour([Date and hour]) > 8
then "Day"
else "Night"
Thanks works perfectly love it
Nope, still having the same problem, the window looks like this also the emote should be number '8'
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |