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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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