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
Syndicate_Admin
Administrator
Administrator

Query about importing data with SQL and separating data into a column

More than a problem is a query:

I am preparing a dashboard connecting by directQuery to a database that is updated at all times, the database has information since 2010, it is immense; Through the help of forums I have managed to import the data to power bi only from the year 2021 (using a SQL query)

when I charge the data table the last column has clustered data, separated by comma, for example (value1,value2,value3,........ value21)

Based on your experience: can you separate that last column using a SQL function by simply entering the function in the power BI box?

in other words: I connect to the database and enter the first query that filters the data only of the year 2021 and also could I enter a function that separates the last column into several columns?

has anyone done this? or just the sql box that power bi brings is for more basic things like filtering by dates only? which is something I've already done

I hope someone based on your experience feed me back, thank you!!

Cesarach69_0-1625709918188.png

note: the problem of separating the last column into several being within power BI is easy, in the icon of transform data there is an option to perform this action, which I am consulting if it can be done before entering a sql function in the data load box

2 ACCEPTED SOLUTIONS
CNENFRNL
Community Champion
Community Champion

You might find something interesting by googling "SQL SPLIT COLUMN"; but it's obvious that PQ is more competent in such a job.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

v-janeyg-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

 

What is entered in this box is sql syntax. You can reference the tutorial:

How to split a column with delimited string into multiple columns in Sql Server - DataMajor

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

 

What is entered in this box is sql syntax. You can reference the tutorial:

How to split a column with delimited string into multiple columns in Sql Server - DataMajor

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

CNENFRNL
Community Champion
Community Champion

You might find something interesting by googling "SQL SPLIT COLUMN"; but it's obvious that PQ is more competent in such a job.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.