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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors