Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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)))))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 34 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 42 | |
| 30 | |
| 28 |