cancel
Showing results for
Did you mean:
Highlighted
sandip Frequent Visitor

## Which one Dax is better?

Hi,

I am using below 2 DAX expressions:

1. SUMX(FILTER('SAVO_QBR_TEMP', ('SAVO_QBR_TEMP'[CNT_ID]="N" || 'SAVO_QBR_TEMP'[Returns Contract_Indicator]="N" || 'SAVO_QBR_TEMP'[Contract_Indicator] = "N") && ('SAVO_QBR_TEMP'[RX]="Y")), 'SAVO_QBR_TEMP'[MI EXT\$])

2. CALCULATE(SUM('SAVO_QBR_TEMP'[MI EXT\$]), FILTER('SAVO_QBR_TEMP', ('SAVO_QBR_TEMP'[CNT_ID]="N" || 'SAVO_QBR_TEMP'[Returns Contract_Indicator]="N" || 'SAVO_QBR_TEMP'[Contract_Indicator] = "N") && ('SAVO_QBR_TEMP'[RX]="Y")))

Please let me know which one is better in respect of performance? as I am new in power bi.

1 ACCEPTED SOLUTION

Accepted Solutions
Mariusz New Contributor

## Re: Which one Dax is better?

Hi @sandip

2. As it is using Context Transition

```Measure 2 =
CALCULATE(
SUM( SAVO_QBR_TEMP[MI EXT\$] ),
SAVO_QBR_TEMP'[RX] = "Y",
FILTER(
SAVO_QBR_TEMP,
SAVO_QBR_TEMP[CNT_ID] = "N"
|| SAVO_QBR_TEMP[Returns Contract_Indicator] = "N"
|| SAVO_QBR_TEMP[Contract_Indicator] = "N"
)
)```

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Mariusz New Contributor

## Re: Which one Dax is better?

Hi @sandip

2. As it is using Context Transition

```Measure 2 =
CALCULATE(
SUM( SAVO_QBR_TEMP[MI EXT\$] ),
SAVO_QBR_TEMP'[RX] = "Y",
FILTER(
SAVO_QBR_TEMP,
SAVO_QBR_TEMP[CNT_ID] = "N"
|| SAVO_QBR_TEMP[Returns Contract_Indicator] = "N"
|| SAVO_QBR_TEMP[Contract_Indicator] = "N"
)
)```

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sandip Frequent Visitor

## Re: Which one Dax is better?

Hi,

You have mentioned the below filter condition out of the filter function:

`SAVO_QBR_TEMP'[RX] = "Y",`

so that does mean that it will work as "AND" with rest of the conditions?

Mariusz New Contributor

## Re: Which one Dax is better?

Hi @sandip

Yes, technically it does the same thing

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.