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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

DAX Formula Optimization - Using Calculate vs. another measure

Hi, I'm just wondering if there is any performance difference in using a simple calculate vs. a measure you've already created in a new DAX formula?

i.e. say we have the measures:

[$ Sales] = SUM(...)

[# Sales] = SUM(...)

[$ Sales LY] = CALCULATE(......)

[# Sales LY] = CALCULATE(......)

[Sales Rate] = [$ Sales] / [# Sales]

 

Which would be faster? Or is the difference minimal?

Sales Rate LY = CALCULATE([Sales Rate], 'Date'[Year] = "2016")

Sales Rate LY = [$ Sales LY] / [# Sales]

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I would expect that in your example, your calculate statement should be faster.  This is because it only needs to make considerations on the table once.

 

How much more optimal?  How long is a peice of string?  It really comes down to the size of your data and what relies on these measures.  Is your table 1 million rows and is your visuals going to be calling this figure 100s of times?

 

To further the optimisation discussion, you can also make use of Variables to increase the efficency of a measure.  Consider this:

Fail % = DIVIDE(
           [No Of Fails],
           [No Of Fails] + [No Of Success]
)

 

Compared to:

Fail % = Var Fails = [No Of Fails]
RETURN
DIVIDE(
           Fails,
           Fails + [No Of Success]
)

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I would expect that in your example, your calculate statement should be faster.  This is because it only needs to make considerations on the table once.

 

How much more optimal?  How long is a peice of string?  It really comes down to the size of your data and what relies on these measures.  Is your table 1 million rows and is your visuals going to be calling this figure 100s of times?

 

To further the optimisation discussion, you can also make use of Variables to increase the efficency of a measure.  Consider this:

Fail % = DIVIDE(
           [No Of Fails],
           [No Of Fails] + [No Of Success]
)

 

Compared to:

Fail % = Var Fails = [No Of Fails]
RETURN
DIVIDE(
           Fails,
           Fails + [No Of Success]
)

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.