Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MightyMicrobe
Helper II
Helper II

Measures on Unrelated Tables

Hi all, I have a model with several fact tables that are only related to each other via a single dimension (Customers). 

A sample file is attached, but specifically: I need to find the total number of customers who called us within 7 days of clicking on a campaign. I can successfully implement this logic in a calculated column in the Customer table ("Calls After Campaign"), but struggling to do the same thing in a measure. 

 

I cannot change the relationships between the tables or implement any bridging tables in a model. 

 

SAMPLE FILE HERE

 

Thank you. 

1 ACCEPTED SOLUTION

Picture1.png

 

Calls After Campaign Measure V2 =
SUMX (
VALUES ( Customers[Customer ID] ),
CALCULATE (
VAR LatestCampaignClick =
MAXX (
FILTER ( 'Campaign Activity', 'Campaign Activity'[Clicks] > 0 ),
'Campaign Activity'[Date]
)
VAR LatestCall =
MAXX ( 'Inbound Calls', 'Inbound Calls'[Date] )
VAR TimeGap =
DATEDIFF ( LatestCampaignClick, LatestCall, DAY )
VAR Result =
IF ( NOT ISBLANK ( TimeGap ) && TimeGap >= 0 && TimeGap <= 7, 1 )
RETURN
Result
)
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
MightyMicrobe
Helper II
Helper II

Thanks @Jihwan_Kim !
How do I apply this measure to get the total number of customers who called?

Picture1.png

 

Calls After Campaign Measure V2 =
SUMX (
VALUES ( Customers[Customer ID] ),
CALCULATE (
VAR LatestCampaignClick =
MAXX (
FILTER ( 'Campaign Activity', 'Campaign Activity'[Clicks] > 0 ),
'Campaign Activity'[Date]
)
VAR LatestCall =
MAXX ( 'Inbound Calls', 'Inbound Calls'[Date] )
VAR TimeGap =
DATEDIFF ( LatestCampaignClick, LatestCall, DAY )
VAR Result =
IF ( NOT ISBLANK ( TimeGap ) && TimeGap >= 0 && TimeGap <= 7, 1 )
RETURN
Result
)
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Jihwan_Kim
Super User
Super User

Hi, 

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Calls After Campaign Measure =
--Latest Campaign Click
VAR LatestCampaignClick =
MAXX (
FILTER ( 'Campaign Activity', 'Campaign Activity'[Clicks] > 0 ),
'Campaign Activity'[Date]
) --Latest Call In
VAR LatestCall =
MAXX ( 'Inbound Calls', 'Inbound Calls'[Date] ) --Gap between events
VAR TimeGap =
DATEDIFF ( LatestCampaignClick, LatestCall, DAY )
VAR Result =
IF (
NOT ISBLANK ( TimeGap )
&& ( TimeGap >= 0
&& TimeGap <= 7 ),
"True",
"False"
)
RETURN
IF ( HASONEVALUE ( Customers[Customer ID] ), Result )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.