Forum Discussion

fabricuser123's avatar
fabricuser123
Frequent Visitor
2 years ago

DataFlow Gen2 is taking forever to refresh with a custom function

I have a custom function that works well in Power BI Desktop. Using the customer function I am trying to generate monthly records in between two given dates. I am trying to move the power query to fabric data lake to keep the table available for other users. The same custom function that comes back quickly (2-3 mins) in Power BI Desktop power query takes forever and times out after 10 mins in Fabric Dataflow Gen2. This makes me think that Fabric Dataflow Gen2 is not ready for custom functions and forces us to Power BI Desktop. Anyone experiencing same issue? Below the M code used for the custom function.

 

= (From as date, To as date) =>
let
NoOfIntervals = (Date.Year(To)*12+Date.Month(To))-(Date.Year(From)*12+Date.Month(From)),
Result = List.Transform({0..NoOfIntervals}, each Date.AddMonths(From, _))
in
Result

3 Replies

  • Maybe try something simpler?

     

    = (From as date, To as date) => List.Generate(()=>From,each _ <= To, each Date.AddMonths(_,1))

    • fabricuser123's avatar
      fabricuser123
      Frequent Visitor

      Tried this but no luck. Same issue. Runs for 10 mins and timeout.