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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Make sure a measure displays 'blank'

I have my measure Revenue YearToDate as

 

CALCULATE( [Revenue] , DATESYTD('Date'[Date],"31/05" ))

 

I want to make sure that whenever I have 0, I display blank and never 0...

 

How can I change it to display 'blank' and not 0?

 

(I know I can put it in a variable and create an IF, but not sure if that's an optimal solution....)

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

 

If you want to make the formula as fast as possible (use only the Storage Engine), then there's a trick:

 

[YTD] =
var ytd =
    CALCULATE( 
        [Revenue],
        DATESYTD('Date'[Date], "31/05")
    )
var result =
    // this is the trick that makes sure
    // only the storage engine is used
    DIVIDE( ytd, ytd ) * ytd
return
    result
amitchandak
Super User
Super User

@Anonymous , Try like

 

Measure =

var _1  _1 = CALCULATE( [Revenue] , DATESYTD('Date'[Date],"31/05" ))

return

if(_1=0, blank(), _1)

 

Blank means it will not display unless you show item with no data

ShowItemwithoutdata.JPG

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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