Forum Discussion
DAX - Blank Data
- 3 years ago
Hi spandy34
For a calculated column, the values returned should be in the same data type so your expected result cannot be achieved. Currently "[Current Performance]-[Previous Performance]" will return a number while " No Previous Data" is in Text type. Returning different types of values in a calculated column will give you the following variant-type error.
Please consider a different result when the Previous performance is blank. Or you can always convert "[Current Performance]-[Previous Performance]" result to Text type with CONVERT function.
Difference = IF ( ISBLANK ( [Previous Performance] ), "No Previous Data", CONVERT ( [Current Performance] - [Previous Performance], STRING ) )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi spandy34
For a calculated column, the values returned should be in the same data type so your expected result cannot be achieved. Currently "[Current Performance]-[Previous Performance]" will return a number while " No Previous Data" is in Text type. Returning different types of values in a calculated column will give you the following variant-type error.
Please consider a different result when the Previous performance is blank. Or you can always convert "[Current Performance]-[Previous Performance]" result to Text type with CONVERT function.
Difference =
IF (
ISBLANK ( [Previous Performance] ),
"No Previous Data",
CONVERT ( [Current Performance] - [Previous Performance], STRING )
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.