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! It's time to submit your entry. Live now!
Hello Gurus,
I'm a newbie in Power BI. I just want to ask if my below syntax is correct. I just want to create a custom column on which I want to apply a duration of +8 hours since Power BI is not showing the correct Date and Time (Timezone).
Dates below Nov 11, 2022 are all displayed correctly. However, the dates greater that Nov 15, 2022 are all in UTC format. Thanks in advance.
===
= Table.AddColumn(#"Changed Type1", "PHCreatedDateTime", each if DateTime.From([Created]) > #datetime(2022,11,11,0,0,0) as datetime then DateTime.From([Created]) + #duration(0,8,0,0) else null)
===
Solved! Go to Solution.
Hello again @Daryl-Lynch-Bzy
I got it now Sir. Instead of null, I just put the DateTime.From([Created]) after else.... Many thanks again. Cheers! 🍻
= Table.AddColumn( #"Changed Type1", "PHCreatedDateTime", each
if DateTime.From([Created]) > #datetime(2022,11,11,0,0,0)
then DateTime.From([Created]) + #duration(0,8,0,0) else DateTime.From([Created]), type datetime)
Hi @rakeman23 - I you thinking along the right line but I think you need to remove "as datetime"
= Table.AddColumn( #"Changed Type1", "PHCreatedDateTime", each
if DateTime.From([Created]) > #datetime(2022,11,11,0,0,0)
then DateTime.From([Created]) + #duration(0,8,0,0)
else null
, type datetime)
Thanks Sir... worked like a charm 🙂
Although the "null" at the end of the statement, made the dates null.. hehe.. Sorry, what I want is for the statement to do "nothing" instead of null so that it will preserve its value
Apologies for the confusion. What should I substitute to null? Many thanks again
Hello again @Daryl-Lynch-Bzy
I got it now Sir. Instead of null, I just put the DateTime.From([Created]) after else.... Many thanks again. Cheers! 🍻
= Table.AddColumn( #"Changed Type1", "PHCreatedDateTime", each
if DateTime.From([Created]) > #datetime(2022,11,11,0,0,0)
then DateTime.From([Created]) + #duration(0,8,0,0) else DateTime.From([Created]), type datetime)
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 14 | |
| 12 | |
| 9 | |
| 7 | |
| 7 |