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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using a measure to concatenate fields with text is removing filtering

Hi,

I have an external Power BI dataset that I have connected to to create a new report.

On this new report, I would like to show a series of records where a particular column is either zero or blank.  I would also like to create a URL, which I have been trying to do via a measure.  The measure is a concate of a static string with the record ID.

The data is in two tables (joined on the Venue ID):

WranglingData_0-1658918586508.png

Without the Measure, the data returned in the table works correctly (I am not summarising any fields, but am filtering on where Takings is either 0 or blank):

WranglingData_1-1658918747411.png

When I simply add the Event ID as a measure, using the following Measure,

Event URL = SELECTEDVALUE(Events[Event ID])

 it works fine:

WranglingData_2-1658918871564.png

When I attempt to concatenate the URL text to the ID, all filtering and grouping is removed.  DAX:

Event URL = CONCATENATE("https://myeventorg.fakedomain/eventId=", SELECTEDVALUE(Events[Event ID])

Result:

WranglingData_4-1658919107124.png

While I understand I could create a custom column on the external data set, I'd really like to achieve this with a measure.

Any clues on what I need to do to get this to work?

Thanks

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Event URL = 
var eventID = SELECTEDVALUE(Events[Event ID])
return IF( NOT( ISBLANK(eventID)), CONCATENATE("https://myeventorg.fakedomain/eventId=", eventID))

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

Event URL = 
var eventID = SELECTEDVALUE(Events[Event ID])
return IF( NOT( ISBLANK(eventID)), CONCATENATE("https://myeventorg.fakedomain/eventId=", eventID))
Anonymous
Not applicable

Looking for that face palm emoji.....

Its always the simple, straight forward answers.

Thanks, that's fixed it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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