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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
anilpoda
Frequent Visitor

How do I know which DAX measure is efficient?

If there are multiple ways to create a DAX measure which yields same result, then how would I know which one to use in my Power BI project? For example using below 2 DAX formulas we can get current year weekly sales, which one is efficient and how? What is the  role of permformace analyzer here?

 

CYW = 
CALCULATE(SUM(Fact_OrderLines[Value]),
FILTER(ALL('Date'),
'Date'[Year] =SELECTEDVALUE('Date'[Year])&&
'Date'[Week No] =SELECTEDVALUE('Date'[Week No])))

 

CYW2 = CALCULATE (
    SUM ( Fact_OrderLines[Value] ),
    FILTER (
        ALL ( Fact_OrderLines ),
        YEAR ( [Order Date] ) = MAX ( 'Date'[Year] )
            && WEEKNUM ( Fact_OrderLines[Order Date] ) = MAX ( 'Date'[Week No] )
    )
)

 

1 ACCEPTED SOLUTION
Thejeswar
Super User
Super User

@anilpoda ,

At first sight, felt the CYW2 measure would be a little slow seeing the MAX() function in the query while the other one does not have any additional functions rather than the selectedvalue()

 

Tried that out with DAX studio to understand the performance with very little data. The Below is the output

CYW

Thejeswar_1-1674388179849.png

 

CYW2

Thejeswar_0-1674388106193.png

The Performance is very close with a difference of 3 ms. But still CYW2 is faster

View solution in original post

3 REPLIES 3
Thejeswar
Super User
Super User

@anilpoda ,

At first sight, felt the CYW2 measure would be a little slow seeing the MAX() function in the query while the other one does not have any additional functions rather than the selectedvalue()

 

Tried that out with DAX studio to understand the performance with very little data. The Below is the output

CYW

Thejeswar_1-1674388179849.png

 

CYW2

Thejeswar_0-1674388106193.png

The Performance is very close with a difference of 3 ms. But still CYW2 is faster

ribisht17
Super User
Super User

Hi @anilpoda 

 

In-case you want to know more about the Performance Analyser

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-performance-analyzer

 

Regards,

Ritesh

Migasuke
Memorable Member
Memorable Member

Hi @anilpoda ,

You have a very good question, because optimisations should be one of the priorities.
The best way how to measure performance of your DAX is via DAX Studio software. It offers more options and details than basic Perf. Analyzer (and sometimes they are actually used together)

In DAX studio you can measure how fast is proccessed, how much performance it takes etc. It is a bit complex topic due to that it is better to check some videos, for example here:

https://www.youtube.com/watch?v=C5HBhlLUFsE&t=1s 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors