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

Substraction formula without displaying "0" results

Hi,

 

This might be a stupid question, but I have this formula: 

 

Unsubmitted =
SUM('report'[Person_Registered]) - SUM('report'[Candidate_Registered])
 
Both columns have 0 and 1 values, 0 means they haven't registered and 1 means they did.
 
Of course, Person_Registered is full of 1's as they wouldn't be in the database if they didn't register but Candidate_Registered has 0's and 1's because some of them didn't finish their application form. 
 
When I add the Measure in a table it shows me the 0's too and I would like it to be blank. Is there something I can add to the formula so the 0's don't display in the table and the rows are left blank?
 
Filtering the 0's out from the Visual level filters is not an option as it takes out the entire row. 
 
PBIDesktop_kGLrdS86AX.png
Thank you very much for your help!
1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @OvidiuNeacsu 

Try this. It will return a blank where the result is zero. You can then select on the visual whether you want to show blanks:

Unsubmitted =
VAR Res_ = SUM('report'[Person_Registered]) - SUM('report'[Candidate_Registered])
RETURN
IF(Res_ <> 0; Res_)

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @OvidiuNeacsu 

Try this. It will return a blank where the result is zero. You can then select on the visual whether you want to show blanks:

Unsubmitted =
VAR Res_ = SUM('report'[Person_Registered]) - SUM('report'[Candidate_Registered])
RETURN
IF(Res_ <> 0; Res_)

 

Thank you @AlB, it works perfectly!

 

Just replaced the ";" with a comma 

IF(Res_ <> 0, Res_)

 The full working formula is: 

Unsubmitted =
VAR Res_ = SUM('report'[Person_Registered]) - SUM('report'[Candidate_Registered])
RETURN
IF(Res_ <> 0, Res_)

 

Have a lovely day!

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.