cancel
Showing results for 
Search instead for 
Did you mean: 
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.

View solution in original post

amitchandak
Super User
Super User

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

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Hey @amitchandak what is the dax should I add?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.