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
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
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
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 90 members 1,547 guests
Please welcome our newest community members: