Hey @ysherriff
What in this case is causign the issue , is that Date table ( Dim table) is Filtering Contact Table ( also a dim table)
(- this is not wrong, but for what you are trying to achieve in your measure, it is giving you undesired results. - I explain that below in detail. )
but now if you also try to activate a relationship between Date Table and Campaigns table, it wont work.
- If you Try to activate any of your inactive relationships ( between date and campaigns table) , this is what you will get
![image](https://forum.enterprisedna.co/uploads/db7134/original/3X/1/b/1ba1762f7a69b6f20d6f943eccec8f1f58d5228b.png)
having said that, You need to understanding whats happening in your model.
Lets forget about all inactive relationships between Date and Campaigns table and focus on the Single Active relationship chain
Date Tabel Fiters Contact Table on Creation Date
Contact Table Filters Campaigns table on email
Because this entire chain of relationships is active, this means that even before your measure gets to work , your Campaign table already getting filtered (evaluation context) based on this chaing of filters
The measure will run its calculation on Campaign table that is filtered by contacts table, based on contacts that have their Creation date falling between the dates in the selected Dates Slcier.
As per the measure you have in palce :
Test MQL =
CALCULATE (
COUNTROWS ( 'Campaigns' ),
FILTER (
'Campaigns',
'Campaigns'[Unique MQL per Contact per Campaign] = "Y" &&
NOT ( ISBLANK ( 'Campaigns'[Revised MQL Date] ) ) &&
'Campaigns'[Revised MQL Date] IN VALUES ( 'Date'[Date] )
)
)
you only want filters on Campaigns’[Unique MQL per Contact per Campaign] and Campaigns’[Revised MQL Date] , ---->>not on the contact creation date<<----
(Look out for some content to understand the concept of Expanded Tables. - That may help you better understand this. )
As soon as you delete the relationship between dates and contact table, the chan is broken.
and this part of dax code, : Campaigns’[Revised MQL Date] IN VALUES ( ‘Date’[Date] ) gives you your desired results.
in this scenario you can activate a direct relationship between date and campaigns table or use the ( userelationship function. - That too should work.
**
I hope that helps.
Regards,
Japjeet