Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
Employee

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
Employee
Employee

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


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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors