Forum Discussion
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
- Anonymous4 years ago
Hi mansiluthra12 ,
Your syntax will return a Table not a Column.
So you may try:
Column1 = CALCULATE(DISTINCTCOUNT('Work'[ID]),FILTER('Work',[Day]=1))Column2 = CALCULATE(DISTINCTCOUNT('Work'[ID]),ALLEXCEPT('Work','Work'[Date]),'Work'[Day]=1)Below is the final output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Fowmy
Super User
mansiluthra12
You add a column, the result of your formula is supposed to produce one value, On which table are you adding column? May you need to get the maximum of the result as follows. Please check: Share the screenshot of your table and the new columntotal = MAXX ( ADDCOLUMNS ( VALUES ( Work[Date] ), "Day", CALCULATE ( DISTINCTCOUNT ( Work[ID] ), Work[Day] = 1, Test[testValue] = "abc" ) ), [Day] ) - Pragati11
Super User
Hi mansiluthra12 ,
I think you need a FILTER expression within your CALCULATE function.
total = ADDCOLUMNS ( VALUES ( Work[Date] ), "Day", CALCULATE( DISTINCTCOUNT(Work[ID]), FILTER(Work, Work[Day] = 1) , FILTER(Test[testValue] = "abc") ) )I haven't tested the DAX, just re-wrote it.
Thanks,
Pragati
- AnonymousNot applicable
Hi mansiluthra12 ,
Your syntax will return a Table not a Column.
So you may try:
Column1 = CALCULATE(DISTINCTCOUNT('Work'[ID]),FILTER('Work',[Day]=1))Column2 = CALCULATE(DISTINCTCOUNT('Work'[ID]),ALLEXCEPT('Work','Work'[Date]),'Work'[Day]=1)Below is the final output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.