Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I'm trying to group time data into day shift and night shift using custom column in power query
I tried a few variations but can't seem to get it right. The conditional statement either executes but has no results or there's some syntax error that does now allow me to execute the statement. The statement has a logical operator AND in it so I can't use the "conditional column" in power query.
The last one executes, but the resultant column simply shows "Error" instead of values. Thank you.
Solved! Go to Solution.
Hello @pborah ,
try the following custom column
if DateTime.Time([received_time]) >= #time(6,0,0) and DateTime.Time([received_time]) < #time(18,0,0) then "Day" else "Night"
Proud to be a Super User! | |
Hello @pborah ,
try the following custom column
if DateTime.Time([received_time]) >= #time(6,0,0) and DateTime.Time([received_time]) < #time(18,0,0) then "Day" else "Night"
Proud to be a Super User! | |
Hi @pborah
Please refer to the solution of @amitchandak in the linked discussion :
https://community.fabric.microsoft.com/t5/Desktop/M-Query-If-Statement-for-Dates-and-time/td-p/17860...
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |