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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Gregpen
Regular Visitor

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

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

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...

Worked a treat, thanks Greg

 

amitchandak
Super User
Super User

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" }
)

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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....

 

Disregard, I figured it out... Thanks.

 

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.

 

Helpful resources

Announcements
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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.