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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Mohsen_2020
Helper III
Helper III

Hiding Blanks in card measure results

Hi Team, 

 

is there anyway to Hiding Blanks in card measure results ?

Untitled.png

 

Regards,

Mohsen

1 ACCEPTED SOLUTION

Hi @Mohsen_2020 

I agree with  CNENFRNL . In addition to CNENFRNL 's reply, CNENFRNL 's measure works well, and I will explain how to do this by a test.

I build a easy table to have a test.

1.png

If we build a measure to calculate the Value when Category = B, and show the measure in Card, it will show(Blank) like your screenshot .

So we can use If function to replace (Blank) with others like 0, "" (Strings).

More info about Var and If function : Var, IF 

 

Measure = 
Var _B = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Category]="B"))
return
IF(_B = BLANK(),"",_B)

 

Result:

1.png

You can download the pbix file from this link: Hiding Blanks in card measure results

 

Best Regards,

Rico Zhou

 

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

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

Hi, @Mohsen_2020 , consider replacing blank() with ""(zero-length string)?

Coaching Score =
VAR __score = ...
RETURN IF ( ISBLANK ( __score ), "", __score )

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

could you please tell me the how to?

Hi @Mohsen_2020 

I agree with  CNENFRNL . In addition to CNENFRNL 's reply, CNENFRNL 's measure works well, and I will explain how to do this by a test.

I build a easy table to have a test.

1.png

If we build a measure to calculate the Value when Category = B, and show the measure in Card, it will show(Blank) like your screenshot .

So we can use If function to replace (Blank) with others like 0, "" (Strings).

More info about Var and If function : Var, IF 

 

Measure = 
Var _B = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Category]="B"))
return
IF(_B = BLANK(),"",_B)

 

Result:

1.png

You can download the pbix file from this link: Hiding Blanks in card measure results

 

Best Regards,

Rico Zhou

 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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