| 1 |
-- COALESCE returns the first non-blank of its arguments |
| 2 |
-- It is commonly used to provide default values to expressions |
| 3 |
-- that might result in a blank |
| 4 |
EVALUATE |
| 5 |
SELECTCOLUMNS ( |
| 6 |
TOPN ( 10, Store ), |
| 7 |
"Store name", Store[Store Name], |
| 8 |
"Manager", |
| 9 |
COALESCE ( Store[Area Manager], "** Not Assigned **" ), |
| 10 |
"Years open", |
| 11 |
DATEDIFF ( |
| 12 |
Store[Open Date], |
| 13 |
COALESCE ( Store[Close Date], TODAY () ), |
| 14 |
YEAR |
| 15 |
) |
| 16 |
) |
| 17 |
ORDER BY [Manager] |
| 18 |
|
| 19 |
-- From https://dax.guide/coalesce/ |
| 20 |
|