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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
hrathi38
Regular Visitor

DAX Improvement

I was just preparing a few measures that'll be hitting against million of records, thus taking a lot of time. I have two DAX formula's that I've written in measures in SSAS (Tabular). All I seek here is to improve the performance of these two formula so that I can even save a few mili seconds on each, thus saving a lot of time over all.

 

1) IF (

    HASONEVALUE ( 'TableName'[QL] ) & SUM ( 'TableName'[Count] ) >= 20,

    CALCULATE (ROUND (DIVIDE (SUM ( 'TableName'[WS]), SUM ( 'TableName'[WB] )),2)* 100 + 100,

    'TableName'[TS] = "ABC" ),

    BLANK ()

        )

 

2) CALCULATE(DISTINCTCOUNT('TableName'[RS]), 'TableName'[WB] > 0)

 

The goal is to use as little as possible from the Formula Engine and rely more on the Storage Engine, or so the best practices say.

 

Thanks,

Harshey

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @hrathi38,

 

As the query need to fetch million of records which is a large dataset loaded into desktop, this would slow down the formula execution and report generation and data refresh. I would suggest you filter out unnecessary data to improve report performance.

 

In your scenario, you could use “Direct Query” mode to connect data. Also, make use of Variables in DAX formula might increase the efficency of a measure.

 

For Formula Engine and Storage Engine, please refer to below links to make better usage of them.

Formula engine and Storage engine in SSAS

optimizing dax expressions involving multiple measures

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

I completely agree to the points that you've mentioned, but these are the measures that I've created in SSAS Tabular model designer, which I suppose can function a lot faster to process a million of records as compared to Power BI.

 

Also, I'm already using Direct Query mode to connect data. And regarding the variables, I think I can surely check on that.

 

Thanks you so much!

Harshey

hrathi38
Regular Visitor

I was just preparing a few measures that'll be hitting against million of records, thus taking a lot of time. I have two DAX formula's that I've written in measures in SSAS (Tabular). All I seek here is to improve the performance of these two formula so that I can even save a few mili seconds on each, thus saving a lot of time over all.

 

1) IF (

    HASONEVALUE ( 'TableName'[QL] ) & SUM ( 'TableName'[Count] ) >= 20,

    CALCULATE (ROUND (DIVIDE (SUM ( 'TableName'[WS]), SUM ( 'TableName'[WB] )),2)* 100 + 100,

    'TableName'[TS] = "ABC" ),

    BLANK ()

        )

 

2) CALCULATE(DISTINCTCOUNT('TableName'[RS]), 'TableName'[WB] > 0)

 

The goal is to use as little as possible from the Formula Engine and rely more on the Storage Engine, or so the best practices say.

 

Thanks,

Harshey

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.