Hi guys,
hope you guys can help me regarding one problem of sorting dimension in pivot table by expression. here is my pivot table:
I would like to order the last dimension - Material based on the measure which is count of batches for the first day - 2019-06-12. Because the date range is dynamic, I used following expression in the "Sort by expression"
AGGR(Count({$<ScheduledDate={"=$(=Date(Min(ScheduledDate),'YYYY-MM-DD')"}>}DISTINCT BatchNumber),Material)
Basically I want materials that have highest count appear first, however it didn't give me the desired ordering for all materials. not sure what was wrong in my expression in set analysis above. any help will be greatly appreciated. Thanks.