I have a table Sales
Date Order No. Order qty Product
Jan 1, 2016 O1 2 P1
Jan 2, 2016 O1 1 P2
Jan 1, 2016 O3 4 P1
Jan 2, 2016 O7 2 P5 And so on
I am trying to write a DAX for all orders in the table
TotalOrders = distinctcount(Sales[OrderNumber])
for e.g. here the number of distinct order IDs would be 3, order number 1, 3 and 7. So totalorders = 3
all orders = calculate([TotalOrders]/all(Sales))
I am getting an error in all orders measure.
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.