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.
I have been struggling with the speed of using Power BI and have assumed that it may be my Surface Pro 3. Trying a PBIX on my home computer yielded quicker results but still not outstanding.
Right now I am waiting for the result of a basic query to appear and it has already been more than 5 mins. Thing is this is all pretty no brained stuff so I am somewhat baffled.
Here's the query
let
Source = Table.FromRecords({
[Name = "Earliest FY", Value=GetEarliestFY(Projects[ProjectStartDate])],
[Name = "Latest FY", Value=GetLatestFY(Projects[ProjectStartDate])],
[Name = "First Day of FY", Value=First_Day_Of_FY],
[Name = "First Month of FY", Value=First_Month_Of_FY],
[Name = "Quarter Title", Value="Quarter_Title"]
})
in
Source
Where the first two look like this (Earliest as the example):
(DateList as list) as date =>
let
//First get the two date extremes
EarliestDate=#date(Earliest_FY,First_Month_Of_FY ,First_Day_Of_FY),
MinDate=let MDate=List.Min(DateList), RetVal = if MDate < EarliestDate then EarliestDate else MDate in RetVal, //no need to go further back than this
//adjust these to the start of financial year
MinDateFY = if Date.Month(MinDate) >= First_Month_Of_FY then #date(Date.Year(MinDate),First_Month_Of_FY,First_Day_Of_FY) else #date(Date.Year(MinDate)-1,First_Month_Of_FY,First_Day_Of_FY)
in
MinDateFY
All of the rest i.e. anything that uses _ are defined PBI parameters. Thing is I did not think any of this was a big deal and it never has been to date. The only thing I wondered about is whether calls to M functions might be expensive. Out side of that I don't understand. It is taking hours to apply anything!
Anybody got any ideas of what is wrong? I'm currently working with every app except my web browser and PBI closed. And I will close the web browser after I post this...
Solved! Go to Solution.
Hi Eric,
I have figured this our. I was using each of these in an addcolumn with a list generater causing these to be called multiple times.
What I did was to create a variable with the return in and then use that in the itterator and the whole thing sped up dramatically. Poor coding on my behalf. I think I assumed it would be optimised but was thinking complier and not interpreter 🙂
I tried to test that function and the rest Power Query code, however they perform well. I don't get any slowness. While saying " It is taking hours to apply anything", is the basic query the only thing in your scenario? How much data in your case?
Hi Eric,
I have figured this our. I was using each of these in an addcolumn with a list generater causing these to be called multiple times.
What I did was to create a variable with the return in and then use that in the itterator and the whole thing sped up dramatically. Poor coding on my behalf. I think I assumed it would be optimised but was thinking complier and not interpreter 🙂
It is great to hear you've figure it out and thanks for sharing the solution. 🙂
You can accept your reply as solution to close this thread.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |