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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
fabricuser123
Frequent Visitor

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 3
fabricuser123
Frequent Visitor

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

lbendlin
Super User
Super User

Maybe try something simpler?

 

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

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

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.