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
JamesMF1982
Frequent Visitor

Return field text when date condition is met

Hi,

 

I am trying to pull the postcodes when a particular date condition is met, i.e. a enquiry was started within the selected month. 

 

I've tried the following:

Measure = calculate(values(PROSPECTS[ProspectPostcode]),USERELATIONSHIP('CALENDAR'[CalendarDate],ENQUIRYDETAILS[EnquiryBecameLeadDate]))

 

but it errors stating "A table with multiple values was supplied where a single value was expected". I know this isn't the right expression, but I am stumped.

 

Any help would be great.

 

Thanks


JAmes

2 REPLIES 2
selimovd
Super User
Super User

Hey  , 

what exactly should the result be?

You return "VALUES( PROSPECTS[ProspectPostcode] )". Values returns a table with the distinct values.

 

What do you expect the result to look like when you return a whole table? Try some kind of aggregation like:

 

Measure =
CALCULATE (
    MAX ( PROSPECTS[ProspectPostcode] ),
    USERELATIONSHIP ( 'CALENDAR'[CalendarDate], ENQUIRYDETAILS[EnquiryBecameLeadDate] )
)

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me:
twitter.com/DenSelimovic

Hi, 

Thanks for getting back to me. What I want to have is a table which just has the postcodes when the lead date was within the selected calendar period. So this might return a table of 30 rows, or 60 depending on the month selected.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors