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
szub
Helper III
Helper III

How to not have "Null" considered a "0"

Hello,

I am creating metrics for days between an arrival date and repair date.  If "0" is the value, we consider this as a "Same Day" repair. My issue is not all of my company branches record arrival and repair date, only the repair, so the value between the arrival and repair is "null" in PBI because it is blank on the uploaded spreadsheet.  When calculating the percentage of work done on the same day compared to all claims for all work done by a servicer, I am getting 100% for the branches that do not record both dates.  I have tried searching for a away to do this and only find how to have "null" populated with zeros, which I do not want to do or other methods that are not applicable.

 

I appreciate any assistance.

 

Thank you!

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

@szub ,

Maybe try ISBLANK() in your formula with an IF

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Super User
Super User

@szub ,

Maybe try ISBLANK() in your formula with an IF

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Nathaniel_C Thank you! That worked!

ChrisMendoza
Resident Rockstar
Resident Rockstar

@szub -

Something like this should replace null with a 0 value.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstQ3stA3MjC0VNJRUorVAQtYwgQMDaBCxgYINbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Value", Int64.Type}}),
    Custom1 = Table.ReplaceValue(#"Changed Type",null,0,Replacer.ReplaceValue,Table.ColumnNames(#"Changed Type"))
in
    Custom1





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



@ChrisMendoza Thank you for the reply, but counting null as zero is what I am trying to avoid.

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.