cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
MarcelBeug Super Contributor
Super Contributor

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
Highlighted
MarcelBeug Super Contributor
Super Contributor

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)

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 6 members 1,746 guests
Please welcome our newest community members: