Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 14 | |
| 9 | |
| 8 | |
| 7 |