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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

How to write COALESCE with condition?

Helo Community,

I am trying to write down formula using DAX COALESCE function and I am getting below error.

“Expressions that yield variant data-type cannot be used to define calculated columns.”

How do I write below formula?

Coalsec =

 

var Good='A&I'[% Price Up or Down]>0.010000 && 'A&I'[Active / Inactive] = "Active"

var Poor='A&I'[% Price Up or Down]>=0.000000 && 'A&I'[% Price Up or Down]<=0.009999 && 'A&I'[Active / Inactive] = "Active"

 

var result=

COALESCE(Good,Poor,"No Impact")

 

return

result

 

Thanks

 

3 REPLIES 3
Anonymous
Not applicable

The SQL Coalesce and IsNull functions are used to handle NULL values. During the expression evaluation process the NULL values are replaced with the user-defined value.

The SQL Coalesce function evaluates the arguments in order and always returns first non-null value from the defined argument list.

Syntax

COALESCE ( expression [ 1…n ] )

amitchandak
Super User
Super User

COALESCE is support in March 2020 release you can use.

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

Thank you so much Amit. I am using March vesion and I am getting below error.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.