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

Column Start Date and End Date in list

Hi guys,

i'm trying to convert this:

 Base.PNG

 

in this:

New Base.PNG

 

Is that possible?

 

Tks!!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Column Start Date and End Date in list

Hi,

In the Query Editor, you need to insert this M code

{Number.From([Start])..Number.From([End])}

Hope this helps.

5 REPLIES 5
Highlighted
AClerk New Contributor
New Contributor

Re: Column Start Date and End Date in list

Hi @Williamspsouza 
Try using Datesbetween function.

 

Super User
Super User

Re: Column Start Date and End Date in list

Hi,

In the Query Editor, you need to insert this M code

{Number.From([Start])..Number.From([End])}

Hope this helps.

Williamspsouza Regular Visitor
Regular Visitor

Re: Column Start Date and End Date in list

I'm sorry but i'm not seeing how to use that in my code.

 

As a test i wrote this code to create a test table:

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8so/vDhfSUfJwFDfwFTfyMDQEsQxhXNidaKVAlJTisBqTJDVmCPUxAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, Start = _t, End = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Start", type date}, {"End", type date}})
in
#"Changed Type"

 

smpa01 Established Member
Established Member

Re: Column Start Date and End Date in list

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClfSUTIw0wciIwNDSwjHyADCidWJVnIFCZnqAxFMHsixgMrHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, Start = _t, End = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Start", type date}, {"End", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {Number.From([Start])..Number.From([End])}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Custom", "Date_Series"}})
in
    #"Renamed Columns"

Capture.JPG

Williamspsouza Regular Visitor
Regular Visitor

Re: Column Start Date and End Date in list

I created a custom column with 

{Number.From([Start])..Number.From([End])}

 then i expanded the custom column

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: 6 members 930 guests
Please welcome our newest community members: