Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
We have two fact tables - Payments and Customer Contacts. We would like to find out how many Payments are made within 6 days of a Customer Contact (a call or email from a collections staff member). Payments and Customer Contacts both relate to DimAccount, and both will have many records for each account.
FactPayments
DimAccountID
PaymentDate
PaymentAmount
FactCustomerContact
DimAccountID
DimCampaignID
ContactDate
This measure uses TREATAS to force this relationship, this allows be to display both dates together in a table.
But I can't seem to figure out how to filter this measure to only show Payments where the DATEDIFF between these dates is between 0 and 6.
Thanks!
@SeanGannon , one the way is to get the contract date in Fact payment
a new column
Con date= maxx(filter(Contract, Contract[DimAccountID] = payment[DimAccountID] && contract[ContactDate]< Payment[Payment Date]), Payment[Payment Date])
now you can only work with payment fact
countx(filter(payment, payment[Payment Date]<= [con date] +6 && payment[Payment Date]>= [con date] ), [DimAccountID])
There are (potentially) many contacts per payment, won't this force repeating records into FactPayment?