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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
spandy34
Responsive Resident
Responsive Resident

DAX - Blank Data

I wondered if anyone could help me please.

 

I want the calculation to take subtract the Current Permance from Previous Performance but if the Previous performance is blank then i want to field to say " No Previous Data"  How would I amend the DAX below please?

 

Difference in Performance =
[Current Performance]-[Previous Performance] 
 
1 ACCEPTED SOLUTION

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. 

vjingzhang_0-1683016457700.png

 

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.

View solution in original post

5 REPLIES 5
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

you could use: if(isblank([Difference in Performance]),"No Previous Data",[Difference in Performance])

 

or 

 

COALESCE([Difference in Performance],"No Previous Data")

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Sorry , I want to create a calculated column.  Please can you amend the DAX for a column.  Sorry

Can you share an example of what your data looks like, as it looks like the measure you referenced is made up of 2 other measures.

spandy34_0-1682419396855.png

 

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. 

vjingzhang_0-1683016457700.png

 

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.