I have a table with a CompanyID, PartnerCompanyID and Sales. If the customer is a group partner company, a further PartnerCompanyID column is filled with the CompanyID of the internal customer.
I’d like to sum the sales but only for sales other than internal sales between the companies within the filter context. That is the sales with no (empty) PartnerCompanyIDs or with PartnerCompanyIDs other than the CompanyID’s within the filter context.
I tried with
SalesExtern = CALCULATE(SUM(Sales[Sales]);Filter(Sales;NOT(CONTAINS(ALLSELECTED(Company[CompanyID]);Company[CompanyID];LASTNONBLANK(Sales[PartnerCompanyID];"")))))
The sum seems to be ok, but the values per line are wrong:
thanks a lot :)