Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer))),0,CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer))))
Solved! Go to Solution.
Try like
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer))))),0,CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer)))))
Hi @San1979 ,
Three right parenthesis were missing in your formula, please see the red mark in the formula below:
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer))) )) , 0, CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer)))) ) |
In addition, your formula looks a bit messy. In fact, you can organize your formula with the help of DAX formatting tool. And if the formula has any error, it will be easier and faster to find the cause after formatted.
Best Regards
Rena
Hi @San1979 ,
Three right parenthesis were missing in your formula, please see the red mark in the formula below:
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer))) )) , 0, CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer)))) ) |
In addition, your formula looks a bit messy. In fact, you can organize your formula with the help of DAX formatting tool. And if the formula has any error, it will be easier and faster to find the cause after formatted.
Best Regards
Rena
Hi @Anonymous ,
Three right parenthesis were missing in your formula, please see the red mark in the formula below:
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer))) )) , 0, CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid]) ,CALCULATE([CUSTid],all(Customer)))) ) |
In addition, your formula looks a bit messy. In fact, you can organize your formula with the help of DAX formatting tool. And if the formula has any error, it will be easier and faster to find the cause after formatted.
Best Regards
Rena
Yeah, that code is a mess. Always format your code properly to avoid this kind of thing. This is what I think you were going for:
Select Conversion=
IF(
ISBLANK(
CALCULATE(
DIVIDE(
COUNTX(
FILTER(
'CUSTOMER Lookup',
[Type]="MEMBER"
),
[CUSTid]
),
CALCULATE([CUSTid],all(Customer))
)
)
),
0, //True statement
CALCULATE(
DIVIDE(
COUNTX(
FILTER(
'CUSTOMER Lookup',
[Type]="MEMBER"
),
[CUSTid]
),
CALCULATE([CUSTid],all(Customer))
)
) //False statement
)
Also, here is a much, much better way to write that code:
Select Conversion=
VAR __Calculation =
CALCULATE(
DIVIDE(
COUNTX(
FILTER(
'CUSTOMER Lookup',
[Type]="MEMBER"
),
[CUSTid]
),
CALCULATE([CUSTid],all(Customer))
)
)
RETURN
IF(ISBLANK(__Calculation),0,__Calculation)
Try like
Select Conversion=IF(ISBLANK(CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer))))),0,CALCULATE(DIVIDE(COUNTX(FILTER('CUSTOMER Lookup',[Type]="MEMBER"),[CUSTid])
,CALCULATE([CUSTid],all(Customer)))))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
102 | |
84 | |
79 | |
70 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |