cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

handling blanks - problem

Hello,

I am trying to assign number of image depending on the value of the nps score. If version is unstable, no nps value is calculated and grey image (num 1) should be assigned. However, DAX calculates blank as infinity so i am having weird (1+4) outcome for the image num.

 1.png

 

Color20 = SUMX( VALUES('Circle tbl'[Circle]) , 
SWITCH( 'Circle tbl'[Circle], 
"green", IF( [nps st/nonst] > 20 , 4, 0 ),
"red", IF( [nps st/nonst] <= 10 , 2, 0 ),
"orange", IF( AND( [nps st/nonst] > 10, [nps st/nonst] <= 20 ), 3, 0),
"grey", IF( [nps st/nonst] = "--" , 1 , 0 ),
0
))

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver V
Resolver V

Re: handling blanks - problem

Hi Boja, 

 

At the end of your SUMX, add '+0', to turn all blanks into zero values.

 

Hope that helps! 

View solution in original post

1 REPLY 1
Highlighted
Resolver V
Resolver V

Re: handling blanks - problem

Hi Boja, 

 

At the end of your SUMX, add '+0', to turn all blanks into zero values.

 

Hope that helps! 

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors