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
Anonymous
Not applicable

DAX Efficiency - SUMX and IF Statement

I am looking to improve the performance of a DAX measure that I am using in a report.  Is there a better way to filter to only evaluate on rows where CY TTM Production <> 0 than how I am doing it?

 

The measure is:

SUMX ( tblDim_Account,
IF (
ROUND ( [CY TTM Production], 2 ) = 0,
0,
( ( [CY TTM WIP] - [TTM Change in Reserve] ) + ( ( [CY TTM Production] - ( [CY TTM WIP] ) ) * [CY TTM Billed Realization] ) )
)
)
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

please try

=
SUMX (
    tblDim_Account,
    VAR CYTTMProduction = [CY TTM Production]
    VAR CYTTMWIP = [CY TTM WIP]
    RETURN
        IF (
            ROUND ( CYTTMProduction, 2 ) = 0,
            0,
            ( ( CYTTMWIP - [TTM Change in Reserve] ) + ( ( CYTTMProduction - ( CYTTMWIP ) ) * [CY TTM Billed Realization] ) )
        )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Anonymous 

please try

=
SUMX (
    tblDim_Account,
    VAR CYTTMProduction = [CY TTM Production]
    VAR CYTTMWIP = [CY TTM WIP]
    RETURN
        IF (
            ROUND ( CYTTMProduction, 2 ) = 0,
            0,
            ( ( CYTTMWIP - [TTM Change in Reserve] ) + ( ( CYTTMProduction - ( CYTTMWIP ) ) * [CY TTM Billed Realization] ) )
        )
)

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.