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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
joefusaro
Frequent Visitor

Returning related text value based on min of some other value

Hi, I'm trying to build some marketing reports that show the initial type of campaign that each person responded to.

 

I've extracted some data which is related as follows:

  • Person has a one-to-many relationship with CampaignMember
  • CampaignMember has a many-to-one relationship with a Campaign.

 

pbi-model.PNG

 

For each row in the Person table, I would like to get the Campaign[Type] that is related to the CampaignMember with the earliest (lowest) FirstRespondedDate.

 

So if a Lead has 5 Campaign Members, get the Campaign Member row with the earliest (lowest) FirstRespondedDate, and return the Campaign[Type] that is related to that Campaign Member.

 

The first step I took was to add a custom column to Campaign Member to get the Type from the related Campaign.

 

CampaignType = RELATED(Campaign[Type])  

On the Person table, I tried a custom column with this formula:

First Lead Source = LOOKUPVALUE(
	'Campaign Member'[CampaignType],
	'Campaign Member'[FirstRespondedDate],
	MIN('Campaign Member'[FirstRespondedDate])
)

 But I got the error "A table of multiple values was supplied where a single value was expected"

 

I've tried a few variations on this formula, but I'm stuck. Any help or guidance is greatly appreciated!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@joefusaro,

 

You may refer to the following DAX that adds a calculated column.

Column =
CALCULATE (
    SELECTEDVALUE ( 'Campaign Member'[CampaignType] ),
    TOPN (
        1,
        RELATEDTABLE ( 'Campaign Member' ),
        'Campaign Member'[FirstRespondedDate], ASC
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@joefusaro,

 

You may refer to the following DAX that adds a calculated column.

Column =
CALCULATE (
    SELECTEDVALUE ( 'Campaign Member'[CampaignType] ),
    TOPN (
        1,
        RELATEDTABLE ( 'Campaign Member' ),
        'Campaign Member'[FirstRespondedDate], ASC
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.