Forum Discussion
Filtering Table rows by earliest date
hi Anonymous
try like:
1) create a calculated table like:
Customer =
ADDCOLUMNS(
VALUES(Service[CustID]),
"ServiceID",
CALCULATE( MIN(Service[ServiceID])),
"Date",
CALCULATE( MIN(Service[Date]))
)2) join service and customer table on the ServiceID column
3) add a calculated column in Service table like:
Type = IF(RELATED(Service[Type])<>"Mobile", "Others", "Mobile")it worked like:
Almost legendary thankyou FreemanZ , I've run it on a real data set and the customer table mostly pulls exactly what I want, the exception is where a mobile and an "other" service have the same start date, and it is the earliest date (for a given customer). DAX has to pick one sevice ID over the other, and I'm not sure of its logic. Can we force it to pick Mobile within the Cust table code when there is a choice to be made?
My other challenge is creating the relationship between the cust table and the services table, Im getting a Circular Dependnecy alert - which is very surprising and probably something seperate for me to trouble shoot.