Reply
Gregpen
Regular Visitor
Partially syndicated - Outbound

Removing (BLANK) results COUNTA formula adding IF(ISBLANK(

I'm having a little trouble adding the IF(ISBLANK function to a measure to remove the resulting (Blank). When trying to add I get the error that the IF(ISBLANK can only work with 1 argument.

 

Count of Source for Red =
CALCULATE(COUNTA('Booking Charge Report'[Source]),
    'Booking Charge Report'[Source] IN { "Red" }
)
Thanks

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Syndicated - Outbound

Right, so maybe try this:

 

Count of Source for Red =
VAR __Value = 
CALCULATE(COUNTA('Booking Charge Report'[Source]),
    'Booking Charge Report'[Source] IN { "Red" }
)
RETURN
IF(ISBLANK(__Value)," ",__Value)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

Syndicated - Outbound

Right, so maybe try this:

 

Count of Source for Red =
VAR __Value = 
CALCULATE(COUNTA('Booking Charge Report'[Source]),
    'Booking Charge Report'[Source] IN { "Red" }
)
RETURN
IF(ISBLANK(__Value)," ",__Value)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Syndicated - Outbound

Worked a treat, thanks Greg

 

amitchandak
Super User
Super User

Syndicated - Outbound

COUNTA will not consider blank,

And if you want blank the try like

Count of Source for Red =
CALCULATE(COUNTX(filter('Booking Charge Report'),not(isblank('Booking Charge Report'[Source]))'Booking Charge Report'[Source]),
'Booking Charge Report'[Source] IN { "Red" }
)

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Syndicated - Outbound

Sorry Greg, Just on that solution, it gave the desired effect but now the actual results are showing with 2 decimal places and the option to change this in the format bar are greyed out....

 

Syndicated - Outbound

Disregard, I figured it out... Thanks.

 

Syndicated - Outbound

Thanks amitchandak, sorry I'm not sure I understand "And if you want blank then try like" from your reply, are you saying that this will remove the (Blank) result from showing in the visual.

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)