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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
M_SBS_6
Helper V
Helper V

Replace BLANK with 0

Hi, 

I have a table which outputs values, but where we don't have a value, the output returned is blank. 

 

Is there anything I can do within my existing logic to return a 0 value instead of Blank, please?

 

Calculate(

Sum('apps'[spend]),

'apps'[sys]= "T"

)

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @M_SBS_6 ,

Please try if this formula helps:

Measure =
VAR _SUM =
    CALCULATE ( SUM ( 'apps'[spend] ), 'apps'[sys] = "T" )
RETURN
    IF ( _SUM = BLANK (), 0, _SUM )

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @M_SBS_6 ,

Please try if this formula helps:

Measure =
VAR _SUM =
    CALCULATE ( SUM ( 'apps'[spend] ), 'apps'[sys] = "T" )
RETURN
    IF ( _SUM = BLANK (), 0, _SUM )

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rsbin
Super User
Super User

@M_SBS_6 ,

Add a "+ 0" to the end of your Statement:

Calculate(

Sum('apps'[spend]),

'apps'[sys]= "T"

) + 0

Best Regards,

Thanks. The problem with doing that is my table now includes more blank records than before. Not sure why it would do that

@M_SBS_6 ,

Can you paste a small sample of your 'apps' data table? 

Exclude any sensitive data.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.