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
Boja
Advocate II
Advocate II

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
JoHo_BI
Responsive Resident
Responsive Resident

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
JoHo_BI
Responsive Resident
Responsive Resident

Hi Boja, 

 

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

 

Hope that helps! 

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.