Forum Discussion
kylebi1
7 years agoFrequent Visitor
Round Down to Nearest 30 Minute Interval (Query Editor)
Is there a way to add a custom column at the query level for rounding down to nearest 30 minute interval? This is my current custom column outside of the query: Interval = TIME(HOUR(v_nm_cic_...
- 7 years ago
Hi kylebi1,
It seems that your formula is written using the Dax function.
In Query Editor, you could create a custom column with the formula below which logic should be more easier.
Nearest 30 Minute Interval= Table.AddColumn(#"Changed Type", "Custom", each Time.From(Text.From(Time.Hour(Time.From([Time])))&":"&(if Time.Minute(Time.From([Time]))>= 30 then "30" else "0")&":00"))
Here is the output.
In addition, you also could have a reference of this video about Round time to nearest x min with Power Query.
Best Regards,
Cherry
v-piga-msft
7 years agoResident Rockstar
Hi kylebi1,
It seems that your formula is written using the Dax function.
In Query Editor, you could create a custom column with the formula below which logic should be more easier.
Nearest 30 Minute Interval= Table.AddColumn(#"Changed Type", "Custom", each Time.From(Text.From(Time.Hour(Time.From([Time])))&":"&(if Time.Minute(Time.From([Time]))>= 30 then "30" else "0")&":00"))
Here is the output.
In addition, you also could have a reference of this video about Round time to nearest x min with Power Query.
Best Regards,
Cherry
kylebi1
7 years agoFrequent Visitor
Thank you!!!!