Forum Discussion
Discrepancy in Unique Order Count When Aggregating Data Using SUMMARIZE Function
- Anonymous1 year ago
Hi, Anonymous
You can try the following methods.
Measure = Var _table=SUMMARIZE( 'Table', 'Table'[City], 'Table'[Product Line], 'Table'[Sales Batch Month], 'Table'[Order ID] ) RETURN COUNTX(_table,[Order ID])Is this the result you expected?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous The discrepancy in the unique order count arises because the SUMMARIZE function is aggregating the data at a more granular level than you intend.
Try using
SUMMARIZE(
Tablename,
City,
Product Line,
Sales Batch,
"No of Orders", DISTINCTCOUNT(Order ID)
)
Then
VAR AggregatedTable =
SUMMARIZE(
Tablename,
City,
Product Line,
Sales Batch,
"No of Orders", DISTINCTCOUNT(Order ID)
)
RETURN
SELECTCOLUMNS(
AggregatedTable,
"City", [City],
"Product Line", [Product Line],
"Sales Batch", [Sales Batch],
"No of Orders", [No of Orders]
)
But wanted to keep dfect code column also in aggregate table. in that case what to do.(in a slicer need to dfect code).