cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
siva3012 Regular Visitor
Regular Visitor

Transform 15 mins interval data into 30 mins data.

Hi, 

        I want to convert the 15 mins interval data into 30 mins interval data. Can anyone guide me in doing this in PowerBI?  

I have the screenshot which is required. 


Untitled.jpg

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Transform 15 mins interval data into 30 mins data.

A Power Query solution:

 

let
    Source = Data15Mins,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", type number}}),
    #"Divided Column" = Table.TransformColumns(#"Changed Type", {{"Time", each Number.RoundDown(_ * 48, 0) / 48, type number}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Divided Column",{{"Time", type time}}),
    #"Inserted Merged Date and Time" = Table.AddColumn(#"Changed Type1", "Merged", each [Date] & [Time], type datetime),
    #"Grouped Rows" = Table.Group(#"Inserted Merged Date and Time", {"Merged"}, {{"Usage", each List.Sum([Usage]), type number}}),
    #"Inserted Time" = Table.AddColumn(#"Grouped Rows", "Time", each DateTime.Time([Merged]), type time),
    #"Extracted Date" = Table.TransformColumns(#"Inserted Time",{{"Merged", DateTime.Date}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Extracted Date",{"Merged", "Time", "Usage"})
in
    #"Reordered Columns"
Specializing in Power Query Formula Language (M)
1 REPLY 1
Super User
Super User

Re: Transform 15 mins interval data into 30 mins data.

A Power Query solution:

 

let
    Source = Data15Mins,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", type number}}),
    #"Divided Column" = Table.TransformColumns(#"Changed Type", {{"Time", each Number.RoundDown(_ * 48, 0) / 48, type number}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Divided Column",{{"Time", type time}}),
    #"Inserted Merged Date and Time" = Table.AddColumn(#"Changed Type1", "Merged", each [Date] & [Time], type datetime),
    #"Grouped Rows" = Table.Group(#"Inserted Merged Date and Time", {"Merged"}, {{"Usage", each List.Sum([Usage]), type number}}),
    #"Inserted Time" = Table.AddColumn(#"Grouped Rows", "Time", each DateTime.Time([Merged]), type time),
    #"Extracted Date" = Table.TransformColumns(#"Inserted Time",{{"Merged", DateTime.Date}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Extracted Date",{"Merged", "Time", "Usage"})
in
    #"Reordered Columns"
Specializing in Power Query Formula Language (M)