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
BigKev
Helper III
Helper III

ignore blank in calculation

Hi all,

I have a calculated measure that counts the ID for each Category, and when the count=0, I want to show blank, which I have worked out. This is my Dax

BigKev_0-1634701044636.png

 

 

Now the problem is when I show it in Table, I have gaps on the rows due to my calculation to show blank.

BigKev_1-1634701044642.png

 

What I want is to ignore it altogether from the table for the count = 0. Does anyone know how I can achieve this?

This is what I’m hoping to get:

BigKev_2-1634701044645.png

 

Thanks in advance.

Cheers,

Kev

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @BigKev ;

You could modify it as follows:

 

Comments2 = 
var PUrgent=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="1-Urgent")+0
var PHigh=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="2-High")+0
var PMedium=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="3-Medium")+0
return 
IF(PUrgent=0,BLANK(),PUrgent&" "&"Tagged as Urgrent"&UNICHAR(10))&
IF(PHigh=0,BLANK(),PHigh&" "&"Tagged as High"&UNICHAR(10)) &
IF(PMedium=0,BLANK(),PMedium&" "&"Tagged as Medium")&UNICHAR(10)

 

vyalanwumsft_0-1634881939366.png

The final output is shown below:

vyalanwumsft_1-1634882004621.png

Best Regards,
Community Support Team_ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @BigKev ;

You could modify it as follows:

 

Comments2 = 
var PUrgent=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="1-Urgent")+0
var PHigh=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="2-High")+0
var PMedium=CALCULATE(COUNT('Table'[ID]),'Table'[SEVERITY]="3-Medium")+0
return 
IF(PUrgent=0,BLANK(),PUrgent&" "&"Tagged as Urgrent"&UNICHAR(10))&
IF(PHigh=0,BLANK(),PHigh&" "&"Tagged as High"&UNICHAR(10)) &
IF(PMedium=0,BLANK(),PMedium&" "&"Tagged as Medium")&UNICHAR(10)

 

vyalanwumsft_0-1634881939366.png

The final output is shown below:

vyalanwumsft_1-1634882004621.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@BigKev , filter that in return statement or at visual level filter and try

Hey @amitchandak what is the dax should I add?

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.

Top Solution Authors