Jonas Harbering
Jonas Harbering

Reputation: 1

Dynamic Link upon User Slicer Selection in Power BI

We have a situation in which we would like to display a dynamically created link, based on user selection. To make this more understandable we are having the following Situation.

  1. A user makes a selection (multiple elements) in a dropdown list.

User Selection

  1. Upon this, I wish to have a single(!) corresponding row concatenating the IDs which can be displayed as a hyperlink in a matrix-visual. Similar to the picture only that both IDs appear in one URL.

Link in matrix visual

I managed to get as far as figuring out the selected IDs with a measure but whenever I deploy this measure/function into a table column all IDs are returned. I thought I have to do this because hyperlinks only work if the data is given in a table column and the corresponding data category is specified as "Web-URL".

Any ideas on how to solve this? Is this possible?

Appreciate any ideas.

Best, Jonas

Upvotes: 0

Views: 2468

Answers (2)

Jonas Harbering
Jonas Harbering

Reputation: 1

Well, this is quite the way I tried to go for. See, if I can clarify the question. In the below picture, you can see that I defined the measure accordingly.

DAX Measure

I defined a calculated column by just referencing the measure in the column.

MyURLToColumn = [MyURL]

Finally the result within the matrix visual is the following.

Resulting URLs

While the URL obtained from the column is properly displayed and used as an hyperlink, the URL includes all IDs (not only the selected ones). Contrarily, the URL from the measure is just the right one (only selected IDs in URL) but it can not be displayed nor used as an hyperlink.

Upvotes: 0

Mike Honey
Mike Honey

Reputation: 15027

I would create a Measure using the CONCATENATEX function. It can combine the values from multiple rows into one string result.

A crude example:

My URL = "http://www.example.com/query&id=" & CONCATENATEX ( VALUES ( 'My Table'[My ID] ), 'My Table'[My ID], "&id=", 'My Table'[My ID], ASC )

When used in a table (with no other fields used in the Values well) you will get a single row with a concatenated URL

Upvotes: 0

Related Questions