Arithmix Functions: SETSPARSE (converting empty measures to numbers)

What is it?
SETSPARSE is very useful where you want to set a value when a measure is empty/has no inputted value (especially for calculations, where a non-number variable would cause an error).

How to write it?
Fx layout: = SETSPARSE(Table.Measure,[value])

Example = SETSPARSE(Year(Employee.End date), 0)
Either (a) use the Year part of an employee’s end date (if present) or (b) force a 0 (if blank/no input).
Then use for calculations that are related to the employee’s End date such as salary costs.

What a helpful function!! For those of you using “SumBy” be sure to include a SetSparse at the beginning of it as well. Example: SETSPARSE(SUMBY(inputs here),0)