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)

View solution in original post

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)

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

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