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

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

Reply
PJStevens
Advocate II
Advocate II

Help optimizing calculated column in Power BI Desktop

Hello,

I created a calculated column that I thought wouldnt be overly complex, but it seems to be taking ages to load over "large" datasets (400k+ rows). I tried to split it up into several calculated columns/measures but it didn't improve the overall performance. I also tried to execute it in Power Query, but was unable to create the same calculation within PQ. In some cases, ive had to wait 1+ hour for it to calculate over the whole dataset.

 

Any tips is greatly appreciated:

Onderbreking =
    var StoringsDuur = 30/1440
    var CurrenDateTime = 'Leveringszekerheid MI'[DateTimeValue]
    var NRowsInRange = ROUNDUP((StoringsDuur*1440)/4,0)
    var Summed = CALCULATE(
                    (SUM('Leveringszekerheid MI'[Counter Onderbreking]))/NRowsInRange,
                    FILTER(
                        ALL('Leveringszekerheid MI'),
                        'Leveringszekerheid MI'[DateTimeValue] <= CurrenDateTime && 'Leveringszekerheid MI'[DateTimeValue] > CurrenDateTime - StoringsDuur
                        )
                    )
return
    IF(Summed = 1,1,0)

For clarification: DateTimeValue is just the DateTimeKey turned into decimals. Counter Onderbreking is identifying how often our heating curve is under a certain value (this is pre-calculated off imported data columns).

This formula is calculating how often there is an interruption in our network (or in other words, the % of how often we deliver without interruptions).

Thanks in advance!

2 REPLIES 2
Anonymous
Not applicable

Hi @PJStevens ,

Use in function Remove all filters from the ‘Leveringszekerheid MI’ table, this can be very resource intensive on large datasets.

You can also use the performance analyzer on the desktop to check which DAX is being used longer.

vxiandatmsft_0-1716776056567.png

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Thanks for the response!

 

I'm not sure what you mean with "Use in function Remove all filters from the ‘Leveringszekerheid MI’ table, this can be very resource intensive on large datasets.", how would I incorporate this into my formula?

 

I will use the performance analyzer to see what is causing it to take so long.


Thanks for the response

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.