Forum Discussion
Anonymous
2 years agoNot applicable
Calculated column DAX
Hi, I have below table and wanted to create calculated column as expected results in the box. Any help. Sr No Product Order Date Apple qty Samsung Qty Nokia qty Calculated Column ...
- 2 years ago
Anonymous So like this?
Column = VAR __Date = [Order Date] VAR __Table = FILTER( 'Table', [Order Date] = __Date ) ) VAR __Result = COUNTROWS( DISTINCT( SELECTCOLUMNS( __Table, "Product", [Product] ) ) ) RETURN __Result
gmsamborn
2 years agoSuper User
Hi Anonymous
I'm assuming you want to find the number of order lines per date.
MyColumn =
VAR _Curr = [Order Date]
VAR _Result =
CALCULATE(
COUNTROWS(
ALLSELECTED( 'Table' )
),
'Table'[Order Date] = _Curr
)
RETURN
_Result
Let me know if you have any questions.