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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

facing error in problem

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))))

 

Capture.JPG

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

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)))))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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

Anonymous
Not applicable

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

Greg_Deckler
Community Champion
Community Champion

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
	)
	


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

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)))))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.