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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.