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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

If condition on percentage values giving wrong output

Hello All,

 

I am just trying to check whethe a column value having blank of zeros by below measure and show the message as data not available if any blank or zeros are there.

 

Sample table

10.PNG

But when i have written condition like the below measure it given me values in all decimals.

AttriCheck = IF(Attrition[Attri%]=BLANK() || Attrition[Attri%]<=0,"Data Not Available",Attrition[Attri%])

Output

 11.PNG

 

Here the values are all in decimals and which are wrong also(Jan-2017 value).

 

Can anyone suggest me why is this happening in percentage values as it is perfectly works in all other types like decimals and whole number.

 

Thanks,

Mohan V

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Since the result of your measure always needs to be the same type (string in your case, since you have the error message), I would just use FORMAT to fixup your decimals.

 

Something like:

AttriCheck = IF(Attrition[Attri%]=BLANK() || Attrition[Attri%]<=0,"Data Not Available", FORMAT(Attrition[Attri%], "0.00%"))

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Since the result of your measure always needs to be the same type (string in your case, since you have the error message), I would just use FORMAT to fixup your decimals.

 

Something like:

AttriCheck = IF(Attrition[Attri%]=BLANK() || Attrition[Attri%]<=0,"Data Not Available", FORMAT(Attrition[Attri%], "0.00%"))

 

Anonymous
Not applicable

Wow @Anonymous that was quick and perfect...

Kudos..

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors