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
tomgag
Resolver I
Resolver I

IF statement and how to avoid blanks

Hi All,

 

I have very simple task but it seems to me that it is an issue with Power BI.

 

I have a looped IF however when there is no value it gives me BLANK as oppose to 0.

 

 Measure= IF('Table1'[Col A] <> 0

, 'Table1'[Col A],IF('Table1'[Col B] <> 0

, 'Table1'[Col B], IF('Table1'[Col C] <> 0

, 'Table1'[Col C],IF('Table1'[Col D] <>0

,'Table1'[Col D], IF('Table1'[Col E] <> 0

, 'Table1'[Col E], 0)))))

 

I tried to add + 0 at the end but it did not work,

 

1 ACCEPTED SOLUTION

The answer is rather easy.

 

I added a measure with the simplest code possible.

 

Measure2=sum('Table1'[Measure]) + 0

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi

Where did you add the 0, if you add it as shown below it should display 0.

 

Measure= IF('Table1'[Col A] <> 0, 'Table1'[Col A],
                     IF('Table1'[Col B] <> 0, 'Table1'[Col B],
                         IF('Table1'[Col C] <> 0, 'Table1'[Col C],
                             IF('Table1'[Col D] <>0,'Table1'[Col D],
                                IF('Table1'[Col E] <> 0, 'Table1'[Col E], 0)
                                   )
                                 )
                             )
                       )+0

Thanks
Raj

 

The answer is rather easy.

 

I added a measure with the simplest code possible.

 

Measure2=sum('Table1'[Measure]) + 0

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.