Forum Discussion
Anonymous
3 years agoNot applicable
DAX Divide function
I want to divide, Count(items.length) / workingDays. { Count(item.length) = count of different product, and Working days = No. of days betwwen two selected dates } for that I wrote DAX function Mea...
daXtreme
3 years agoSolution Sage
Anonymous
Each DAX function has input arguments with their correct types and output with the correct type. When you pass something to a function, you have to obey the rules of syntax and types. It's like in mathematics: you can't expect that adding a set to a number will yield something meaningful - they are different objects and the "+" operation is not defined for them. VALUES, as already pointed out, is a TABLE FUNCTION, not a scalar, so you can't put it under DIVIDE which expects 2 scalars.
You probably fish for something like:
[Measure 4] =
DIVIDE(
DISTINCTCOUNT( 'Production of the day'[productshortname] ),
DISTINCTCOUNT( 'Production of the day'[actualendtime] )
)
If you're not sure about a function, go to http://dax.guide and look for it (there's a Search box on the left-hand side). Then pay attention to the input and output.