cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
s-turn
Resolver I
Resolver I

Why is it splitting lines when I haven't asked it to?

Hello,

I'm having a frustrating problem with Power Query in Power BI.  The data source is a .csv.  There are just nine rows of data in the .csv itself, plus a header row making ten.   However, Power Query is displaying it as 13 rows.  It does this from the very beginning - i.e. if I click on the Applied Step "Source", it is already like that.

I have figured out that it seems to be splitting lines where the Start Date field is null - but why?

Here is the code generated.  Any hints much appreciated.

 

 

 

let
    Source = Csv.Document(File.Contents("C:\Users\MyName\MyOrg\Filepath\AllCommunityEvents.csv"),[Delimiter=",", Columns=22, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Community Event ID", type text}, {"Event Type", type text}, {"Registration Date", type date}, {"Event Name", type text}, {"Event Description", type text}, {"Start Date", type date}, {"End Date", type text}, {"Serial Number", Int64.Type}, {"Supporter Type", type text}, {"Event Status", type text}, {"Event Category", type text}, {"Origin", type text}, {"Source Code", type text}, {"Suggested Destination Code", type text}, {"Event Manager", type text}, {"Initial Fundraising Target", Int64.Type}, {"Fundraising Target", Int64.Type}, {"Total Raised", Int64.Type}, {"Total In Progress", Int64.Type}, {"Created", type datetime}, {"Created By", type text}, {"Entity Ref Type", type text}})
in
    #"Changed Type"

 

 

 

Thanks,

Sophia

2 ACCEPTED SOLUTIONS
mahoneypat
Super User IV
Super User IV

Try using just this in your Source step, so you see how it looks with the default values.

 

Csv.Document(File.Contents("C:\Users\MyName\MyOrg\Filepath\AllCommunityEvents.csv"))

Csv.Document - PowerQuery M | Microsoft Docs 

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Hold the phone - I've solved it!  I changed QuoteStyle.None to QuoteStyle.Csv.  Thank you so much for the tip.

View solution in original post

3 REPLIES 3
mahoneypat
Super User IV
Super User IV

Try using just this in your Source step, so you see how it looks with the default values.

 

Csv.Document(File.Contents("C:\Users\MyName\MyOrg\Filepath\AllCommunityEvents.csv"))

Csv.Document - PowerQuery M | Microsoft Docs 

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Aha!  Thanks @mahoneypat , when I do that, there are just 9 rows, and they all look accurate.

Do you have any ideas on which part of the source settings might be the problem?

Hold the phone - I've solved it!  I changed QuoteStyle.None to QuoteStyle.Csv.  Thank you so much for the tip.

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Kudoed Authors