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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SchuWaMax
Frequent Visitor

Calculate Max date column in composite model performance

Hello,

 

I can't understand the reason why I have such a bad performance. 

Constellation:


- One Dataset in Power BI Service with direct query with 5mb (only one relevant table screenshoted)
- Local model with a new date table 

For some reason the calculation runs out of memory (RAM is not the problem). When I try to calculate the max from the ordenary calender table it works fine. 

Do you have any idea to solve my problem?

 

SchuWaMax_0-1716447730869.png


Date table in Power Query:
let
Quelle = {Number.From(#date(2022,01,01))..Number.From(Date.EndOfYear(Date.From(DateTimeZone.UtcNow())))},
#"In Tabelle konvertiert" = Table.FromList(Quelle, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Geänderter Typ" = Table.TransformColumnTypes(#"In Tabelle konvertiert",{{"Column1", type date}}),
#"Umbenannte Spalten" = Table.RenameColumns(#"Geänderter Typ",{{"Column1", "Datum"}})
in
#"Umbenannte Spalten"

2 REPLIES 2
SchuWaMax
Frequent Visitor

Hi @Anonymous ,
thank for your answer. 

The only difference is SUM instead of SUMX, right? Also used calculate in my measure. I tried your solution and didn't work, sorry.

Anonymous
Not applicable

Hi @SchuWaMax ,

Base on your description, it sounds like you're experiencing some performance issues with your Power BI composite model. You can update the formula of your measure as below and check if it can work well:

TEST max date =
CALCULATE (
    SUM ( 'DirectQuery facts'[Kosten] ),
    FILTER (
        'DirectQuery facts',
        'DirectQuery facts'[arbdatum] <= MAX ( 'New local dates'[Datum] )
    )
)

 Note that this measure uses the CALCULATE function instead of the SUMX function, which can be more efficient when working with large datasets. Additionally, the MAX function is only used once in the measure, which can help reduce the amount of iteration required.

 

In addition, you can refer the following links to optimize your DAX formula:

Video:

[DAX] Best Practices 101 for Optimization & Performance (with Alberto Ferrari) 

DAX Optimizations Examples with Alberto Ferrari 

Blog:

DAX Optimization Examples

How to Use DAX Studio to Optimize DAX Code 

Best Regards

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors