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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi everyone
In the Query Editor I have a column with Timestamps and in another column I have a number.
See the picture below.
That number is the hour offset I want to plus into the timestamp.
The result should look like this:
I can create a new column where I do the calculation with this command = [Timestamp] + #duration (0, [Hours Offset], 0.0)
But is it possible to do the calculation in the original column?
Thanks in advance
Solved! Go to Solution.
Hi @M-M-P
Credit to @ImkeF for this method using Table.ReplaceValue (post here)
Rather than adding a new column, put this in the formula bar (where PreviousStep is the name of your previous query step):
= Table.ReplaceValue(PreviousStep, each [Timestamp], each [Timestamp]+#duration(0,[Hours Offset],0,0), Replacer.ReplaceValue, {"Timestamp"})
This has the side-effect of discarding the column type of Timestamp.
To avoid losing the column type, you can use this code instead:
= Value.ReplaceType(Table.ReplaceValue(PreviousStep, each [Timestamp], each [Timestamp]+#duration(0,[Hours Offset],0,0), Replacer.ReplaceValue, {"Timestamp"}), Value.Type(PreviousStep))
Regards,
Owen
Hi @M-M-P
Credit to @ImkeF for this method using Table.ReplaceValue (post here)
Rather than adding a new column, put this in the formula bar (where PreviousStep is the name of your previous query step):
= Table.ReplaceValue(PreviousStep, each [Timestamp], each [Timestamp]+#duration(0,[Hours Offset],0,0), Replacer.ReplaceValue, {"Timestamp"})
This has the side-effect of discarding the column type of Timestamp.
To avoid losing the column type, you can use this code instead:
= Value.ReplaceType(Table.ReplaceValue(PreviousStep, each [Timestamp], each [Timestamp]+#duration(0,[Hours Offset],0,0), Replacer.ReplaceValue, {"Timestamp"}), Value.Type(PreviousStep))
Regards,
Owen
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 64 | |
| 45 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 115 | |
| 114 | |
| 38 | |
| 36 | |
| 26 |