Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
VAR result =
IF (
ISBLANK ( [col1] ),
BLANK (),
IF (
ISBLANK ( [col2] ),
BLANK (),
( DIVIDE ( [col1], [col2] ) - 1 )
)
)
RETURN
result
Does anyone know how to convert code using Coalesce ?
Thanks for your support.
Solved! Go to Solution.
Here's an example of how the code can be converted using Coalesce:
VAR result = DIVIDE ( COALESCE ( [col1], BLANK() ), COALESCE ( [col2], BLANK() ) ) - 1 RETURN result
Coalesce is a function that returns the first non-blank value in a list of expressions. In this case, it's being used to replace the ISBLANK function. The result will be the same as the original code but using a different function.
Here's an example of how the code can be converted using Coalesce:
VAR result = DIVIDE ( COALESCE ( [col1], BLANK() ), COALESCE ( [col2], BLANK() ) ) - 1 RETURN result
Coalesce is a function that returns the first non-blank value in a list of expressions. In this case, it's being used to replace the ISBLANK function. The result will be the same as the original code but using a different function.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!