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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
y-k
Frequent Visitor

optimizing data load from SQL server, power query vs DAX

I have quite large data table I would like to load on beginning as source data table.
Then I like to filter out data, into smaller tables.


I just realized, by using duplicate or reference on source data table, I create a new SQL query. which is fine in a sense, but I have +100 smaller tables I wish to create, that means +100 seperate SQL querries, that is too much for me.

 

Is there any other way to do this is power query, or should I use DAX?


Only reason I like to use power query is, that I can easily create index number for my small tables, is there way to do this in DAX?

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @y-k,

 

If you prefer to use DAX, you can use the "FILTER" function to create new tables that contain only the rows you want. To create index numbers, you can use the "RANKX" function.

 

Small Table 1 = FILTER('Large Table', 'Large Table'[Column 1] = "Value 1" && 'Large Table'[Column 2] = "Value 2")

Small Table 1 with Index = ADDCOLUMNS('Small Table 1', "Index", RANKX('Small Table 1', 'Small Table 1'[Column to Rank],,ASC))

 

Let me know if this works for you.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @y-k,

 

If you prefer to use DAX, you can use the "FILTER" function to create new tables that contain only the rows you want. To create index numbers, you can use the "RANKX" function.

 

Small Table 1 = FILTER('Large Table', 'Large Table'[Column 1] = "Value 1" && 'Large Table'[Column 2] = "Value 2")

Small Table 1 with Index = ADDCOLUMNS('Small Table 1', "Index", RANKX('Small Table 1', 'Small Table 1'[Column to Rank],,ASC))

 

Let me know if this works for you.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

@Sahir_Maharajthank you!
What about Power query solution, does such exist, or does it require always reloading each +50 querries, or is there way to reuse one query, and split it into smaller tables without reloading +50 different querries?


And about DAX solution, do i need to create this measure for each of my +50 tables, or is there way to do it in mass?

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

Top Solution Authors