One thing not mentioned in the video is to be aware and careful about SQL Injection.
@Plackyu3 жыл бұрын
Would love to see a video on SQL injection + Power BI and how to mitigate potential issues
@kkkkkkkkkkk-kkkkkkk2 жыл бұрын
Can Best Practice Analyzer catch SQL injection?
@daryllynch9983 жыл бұрын
Hi Adam, thanks for the Video. I use this approach all the time. One thing that I don slightly different is to use the List.Buffer function because sometimes, I want PQ to read the List only once to get the full Set. I find it sometimes help performance. One suggestion for each time is consider Folding Query scenario. In this situation the following statement works: #"Filter Rows" = Table.SelectRows( Source, each List.Contains( CurrencyList, [Source Column] ) ) This leads to folder query in most data sources. I also feel this can be more effective T-SQL because the filter is applied to the main table without the need to the Left or Inner Join.
@kaizen520713 ай бұрын
This will probably be my approach as well. I think it comes down to skill level in M and SQL. Some will tilt towards SQL and some will with M. Since, i do not know much SQL i tinker with M until each step in query folded. But i do not think Table.SelectRows will be significantly better than the one Adam was written, as he also have removed merges. Have you seen your native query after table.selectrows, was it different to the one generated for Adam.
@ItsNotAboutTheCell3 жыл бұрын
M-ind bending! Love the Advanced Editor and some neat tricks in here too for those performance folks! Keep up the PQ videos! One happy CAT!😻😻😻
@JCMCodaste3 жыл бұрын
This is a great video! thank you, Adam. Good to see that you guys are playing more with dataflows now! I will take it as a good sign of their "health" within the Power BI roadmap! (at my own risk ;) It would be great to have more videos on how to optimize dataflows deployment when linking them across different workspaces (also where the latter are engaged in a deployment pipeline!) ..choosing between the two different connectors in those specific situations is still making me scratch my head, to be honest. Happy 2022!
@billcoleman20093 жыл бұрын
Nice. You could probably hook straight to the table, use selectcolumns() & filter steps and let query folding do its thing to keep it clean for incremental refresh etc - that should work, right?
@pabeader19413 жыл бұрын
Added this to my BI Goodies playlist. Good job and good timing for me. Have a project where this is going to come in handy. Not so much for the performance gain as an easy way to get excel into PQ.
@michelleleroux17283 жыл бұрын
Learning to optimise is my goal for 2022! Thanks, Adam.
@Kierslee11 ай бұрын
Adam, where can I find the details regarding the time and resources to run the refresh (cpu, memory, etc.)?
@tkadosh2 жыл бұрын
Really amazing and efficent way ... Congratulations
@mikemagill6811 ай бұрын
Q. Awesome video. This is exactly the challenge I’m facing currently but m pulling in a SQL table with c. 54. million rows and then need to eliminate rows based on an external table with c. 10,000 rows. I totally get what you’ve done but can you inject a SQL ‘WHERE’ command with a comma separated list of 10,000 values? Is there an upper limit?
@noahhadro82133 жыл бұрын
Awesome video. How would I do this if I wanted to filter that table but was not using a native query. so I connect to a table in sql and then I want to filter the table based upon a column IN a list of items from an excel spreadsheet?
@DanielWeikert3 жыл бұрын
Where can I see which operation is "expensive" and should be avoided? Is there a reference doc for that? Thanks
@Narses33 жыл бұрын
Dataflow = slow, Understand what each step is doing, and what isn't folding to the source, An inner merge (filter) isn't folding to the source = all the data is being queried before then being filtered by the mashup engine There is no silver bullet , but if you understand what each step does (and isnt doing) then you can optimize, as with a lot of things it comes with experience.
@bbangel902 жыл бұрын
I have a Power App Dataflows which transforms and load data to a Dataverse table . This operation now takes around 50 minutes to complete, and I am speculating that the issue is not in the calculation in Power Query, but rather in the loading operation to the Dataverse table. How can I go about optimizing/improving the data loading performance?
@wmfexcel3 жыл бұрын
WOW! It makes a huge difference! May I know if there is any performance boost if we applied the Filters instead of doing it by Merging Queries?
@LifeatAustralia Жыл бұрын
Amazing Video Guy in a Cube 🙂 Would you please tell me how to manage merge queries when merged two tables through two different API calls. Is there any way to optimize API calls?
@louism.49807 ай бұрын
Very insightful, thank you!
@romualdulcyfer3 жыл бұрын
That's impressive !! I have some mergers in my PQ (eg. at data cleansing) which I need to somehow optimize after your video.
@remyschrader9286 Жыл бұрын
In Advanced Editor: ‘PromotionKeysAsList = Promotion[PromotionKey], CurrencyKeysAsList = Currency[CurrencyKey],’ Values from a column in a table return as a list from ‘NeedValuesAsListType = TableName[ColumnName]’
@coolblue59293 жыл бұрын
I’ve been doing this for a long time, initially in datasets (and excel) and then in dataflows. I wrote custom functions to convert from tables to SQL clauses (IN or VALUES) and a custom, multi-replace function to hack the SQL text. I also use parameters of the form :from and :to, for example, to fold back range filters into the native SQL also using the multi-replace function. Things change quickly with monthly updates but, the biggest problem with this approach has been finding the right pattern to satisfy the formula fire-wall. It would be great to compliment this video with a structured commentary on this, along with careful explanation of the potential problems with SQL injection.
@coolblue59293 жыл бұрын
I would also suggest that, if doing such a trivial merge breaks M then M is seriously broken.
@Korallis12 жыл бұрын
Ok so this is all great and everything but what about when you have to merge in order to get the data you require for creating relationships? Is it better to just create a SQL query to provide the exact data your after? I have such a complex model structure and as such I have a lot of merges but the source is almost always sql
@sidharh1003 жыл бұрын
Hey Adam, I was just wondering, if you could possibly make a video regarding Significance Testing in Power Bi?
@visheshjjain3 жыл бұрын
Instead of filtering, If you want a column from your an external file in your fact table, is there any other way, apart from merge, to do it in PQ? Thank you!
@fsanfo Жыл бұрын
I have this query that takes 20m to run in my Oracle PL/SQL client. And I discovered that PQuery Online evaluates querys for 10 minutes only. So what do you recommend me? Retrieve the data by chunks or something else? I'm Pro User using Power BI service.
Nice example, but curious on the syntax in the where clause. What were the “&” doing around PromotionList and CurrencList?
@dipeshbhundia12903 жыл бұрын
Concatenation to access the variables
@pabeader19413 жыл бұрын
They are there to 'build' the actual string that is being sent to the data source. & is the concatenate operator. It's used to combine strings together.
@TheAalouis2 жыл бұрын
Great Job, explaining the refresh protocol columns. I am having an pretty expensive relative join in my dataflow script (find keyword in a text field and join that). Maybe this is something for your goal 2022! :)
@gravestoner24882 жыл бұрын
All my data comes in excel sheets, i have 1 sheet per month for 2 different data fact sheets. Is there a good way to combine these automatically without merging?
@klaustrampedach73123 жыл бұрын
Great video! 😊 The trick also works with a non-native query. Might come in handy 😎
@vikramanmohan1213 жыл бұрын
I have done this for multiple SQL queries where one SQL statement executed using a parameter and becomes an input for the next. One thing I learnt will make things easier is to store the quietly in a variable and pass it to source and you can paste your SQL query from your code editor directly on to the variable in Power Query
@emilymorrison42632 жыл бұрын
How do you approach this if the merge is on two or more fields?
@MrSparkefrostie Жыл бұрын
For anyone running into issues where your list converts to a table, this should help if your query is SQL, will need some tweaks if you use a differrent source. I am guessing it changes to table as its a live source and not sitting with load disabled Text.Combine(Sql.Database("Server", "Database", [Query = "SELECT CAST([NeededColumn] as VARCHAR) AS NeededColumn FROM [dbo].[NeededTable] WHERE Conditions = Conditions "])[NeededColumn], ", ")
@GuyInACube Жыл бұрын
Appreicate the call out on that. Will need to look at that more 👊
@MrSparkefrostie Жыл бұрын
@@GuyInACube All good, this issue was driving me...bananas....
@danmeiss3 жыл бұрын
Adam's version of "unplugged". See the thought process behind problem solving...
@mohammedameen94772 жыл бұрын
Awesome Video, How can we solve this when we have two tables which we want to merge and the data is coming from a flat file like csv or txt. I would want to perform left outer join on these two table based on some condition like IF (Table1[Column] = Table2[Column], Table2[Column], 0) Suppose if we have only one column from Table2 which we want to bring in Table1. We can convert that column in a list and use List.Select and write a condition but when we want to bring two columns or more how will do that. Can you help me with this. Thanks :)
@olemew2 жыл бұрын
csv file is not sql based, you cant do that
@olivierfiliatrault60272 жыл бұрын
Amazing! One question: will the resulting query fold?
@9zQx86LT2 жыл бұрын
Can this work with cosmos db?
@kasmirasmarzo3 жыл бұрын
So useful. I’m doing merges everywhere and because I’m not a ‘real data scientist’ (I’m in regulation!) I have an itty bitty laptop. I’m constantly running out of memory.
@fluffigverbimmelt2 жыл бұрын
Nice, I might be able to use this on a db where DBA only let's us access via NOLOCK hint (yeah, don't get me started on that)
@jls143 жыл бұрын
Excellent video 👍. If advanced editor is scary, you can also do the text combine as a new step too. That way you don't have to do so much text editing. But SQL injection is pretty cool. Fantastic explanation as always 👍.
@manawaajirioghene62312 жыл бұрын
This is such a great video
@bijilabs75993 жыл бұрын
Wow😍 You guys are awesome!
@michalmolka3 жыл бұрын
Really great video!
@dbszepesi3 жыл бұрын
Nice, more of this please!
@MrSparkefrostie Жыл бұрын
What I am looking for is to apply predicates against an upstream dataflow, maybe it does this already, time will tell
@rakeshverma-fi2ju3 жыл бұрын
Hey everyone, We are refreshing a dataset against a dataflow that is using an incremental refresh and our C drive of gateway servers is hitting 0 MB space( from 400GBs). Is there anything we are doing wrong…
@Anthony_Lecoq3 жыл бұрын
Great stuff Adam ;)
@ReadySteadyExcel3 жыл бұрын
Awesome thumbnail!!
@kebincui7 ай бұрын
Super ! 👍👍❤❤
@cirilolhoycuenco62612 жыл бұрын
This is so cool!
@blank37863 жыл бұрын
You guys are amazing
@Baldur10053 жыл бұрын
I know this against Roche's Maxim, but refresh time-outs are not worth it. I do "Group Bys" and Merges in DAX and if I want to to enrich table I use relationship or lookup function, doing those in DAX hurts performance by little margin and increase model size, but time-outs are much much worse.
@matthieumamet34973 жыл бұрын
Great video ❤
@Narses33 жыл бұрын
Nice video concept to explain the mashup containers, also a nice showcase of other people Frankensteining queries/dataflows potentially over time from different people . Not sure if the exact problem you solved for the customer was as simple as this problem, but if it was then the team that manages dataflows/powerbi really should have seen this a mile off , but I guess not everyone knows everything to do with powerbi. I appreciate things are obvious in hindsight but I would be really surprised if a problem like this really did make its way to your desk.
@davidlopez-fe2lb3 жыл бұрын
To your point Jonathan, I feel like the "architect" team should've have guidelines on how to build things, so monsters like this don't get created. We just brought on Power BI Desktop + Service onto our org and we've set no guidelines on how to build, so we'll see plenty of monsters like this. It's just a classic org problem of migrating processes over to the new platform asap, "we don't care how it gets done as long as its done" scenario. Luckily I watch Guy in a Cube weekly, and so far have minimized the monsters I've built.
@ItsNotAboutTheCell3 жыл бұрын
Can confirm, with the constant release of new features, it's often difficult to keep up with each nuance of the product, especially for those who aren't in Power BI for 40 hours a week (as simple or as complex as the topic may be). I always appreciate the opportunity to see the product with "fresh eyes" though and see some light bulb moments when people learn something new that can help them in the future.
@trevorc7734 Жыл бұрын
Brilliant!!
@pawewrona97493 жыл бұрын
Was laughing really hard when I heard that Adam and Patrick had a "race competition"
@matthiask46023 жыл бұрын
This almost like in Inception. Just with a list.
@ekaterinazamosha41493 жыл бұрын
wow !!!!! Thank you!
@WojennyMlotek2 жыл бұрын
Yep, more optimazation please
@matthiask46023 жыл бұрын
finally a GIAC M-Code video. #avoidthewait
@ItsNotAboutTheCell3 жыл бұрын
More M!!!
@sirojiddinsobirov55083 жыл бұрын
Insane Amazing!!!!!
@biexbr2 жыл бұрын
Mannn, I do this a Lot! And I mean a lot lot.
@Phoenixspin Жыл бұрын
The thumbnail makes me think of monkey brains. (Indiana Jones reference)