Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have a sales table and company table like the below.. I am trying to build a measure that counts the number of contractkeys per user... but only where the solduserkey is the same owneruserkey in the company table.
So for example, for contractkey 10, the solduserkey was 111 and the companykey was 736. On the company table, companykey 736 is "owned" by 111, so we would count this sale.
ContractKey 12 has a sold user key of 112 and a companykey of 222... but on the company table, companykey 222 is owned by owner user key 111 so this wouldn't count.
Does that make sense? What would the best way be to achieve this? (using SSAS tabular live connection)
Solved! Go to Solution.
Hi @jd8766
You can try this measure
Count of Contracts =
VAR _companyKeys =
CALCULATETABLE (
VALUES ( Company[CompanyKey] ),
FILTER ( Company, Company[OwnerUserKey] IN VALUES ( Sales[SoldUserKey] ) )
)
RETURN
COUNTX (
FILTER ( Sales, Sales[CompanyKey] IN _companyKeys ),
Sales[ContractKey]
) + 0
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @jd8766
You can try this measure
Count of Contracts =
VAR _companyKeys =
CALCULATETABLE (
VALUES ( Company[CompanyKey] ),
FILTER ( Company, Company[OwnerUserKey] IN VALUES ( Sales[SoldUserKey] ) )
)
RETURN
COUNTX (
FILTER ( Sales, Sales[CompanyKey] IN _companyKeys ),
Sales[ContractKey]
) + 0
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.