Forum Discussion
montilla
6 years agoRegular Visitor
Distinct count considering last date
Hello friends! I have the following product sales facts table: Order Product Delivery Date cStatus 1 Mouse 2019-12-01 Delayed Delivery 1 Keyboard 2020-01-01 Delayed Delivery 2 ...
Anonymous
6 years agoNot applicable
montilla Here is my approach.
First create a calculated column to get the max date per order.
Column = CALCULATE(MAX('FollowUp'[Delivery Date]),ALLEXCEPT('FollowUp','FollowUp'[Order]))Modify your measure. i.e. use new column in relationship instead of delivery dates.
Measure = CALCULATE(DISTINCTCOUNT(FollowUp[Order]),USERELATIONSHIP('Calendar'[Date],FollowUp[Column]),FollowUp[cStatus]="Delayed Delivery")If it helps accept as solution.