kjelsrud.dev/node_modules/shiki/samples/dax.sample

20 lines
527 B
Text
Raw Normal View History

2023-07-19 21:31:30 +02:00
-- COALESCE returns the first non-blank of its arguments
-- It is commonly used to provide default values to expressions
-- that might result in a blank
EVALUATE
SELECTCOLUMNS (
TOPN ( 10, Store ),
"Store name", Store[Store Name],
"Manager",
COALESCE ( Store[Area Manager], "** Not Assigned **" ),
"Years open",
DATEDIFF (
Store[Open Date],
COALESCE ( Store[Close Date], TODAY () ),
YEAR
)
)
ORDER BY [Manager]
-- From https://dax.guide/coalesce/