Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello community,
I'm stucked with M formula:
My formula doesn't return what I expected:
if [Hours] = {8,8.5,9,9.5,10,10.5,11,11.5} then "morning" else if [Hours] = {18,18.5,19,19.5} then "night" else "none"
I have none everywhere
Thank you very much for your help.
Solved! Go to Solution.
Hi @FranckGbadamass ,
Try this:
if [Hours] >= 8 and [Hours] <= 11.5 then "morning"
else if [Hours] >= 18 and [Hours] <= 19.5 then "night"
else "none"
Pete
Proud to be a Datanaut!
Hi @FranckGbadamass ,
Try this:
if [Hours] >= 8 and [Hours] <= 11.5 then "morning"
else if [Hours] >= 18 and [Hours] <= 19.5 then "night"
else "none"
Pete
Proud to be a Datanaut!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |