cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wayers Member
Member

DAX - Return 2 rows of a column with a lookup

Community,

In table1 below I have a CASE ID column and a CASE ID REF column.

CONNECTED TABLE 1.JPG

 

 

 

 

In table1 CASE ID REF represents the CASE ID that we would like the compare the CASE ID in that row to.

 

I would like to have a measure that returns the both the CASE ID's of both numbers referenced in the row (CASE ID and CASE ID REF).

 

Example:

IF I were to filter on CASE ID 2 in Table1, I would like to have a measure that returns the CASE ID and the corresponding CASE ID of the CASE ID REF, such that it would return:

CASE ID

1

 

Any help is appreciated!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: DAX - Return 2 rows of a column with a lookup

@wayers 

 

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Tricky-Slicer-Options/m-p/573381#M270846

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

2 REPLIES 2
Super User
Super User

Re: DAX - Return 2 rows of a column with a lookup

Measures can only return 1 value, by design.  You can easily set up two measures that return each value, or a measure that returns both values as a concatenated string, but not 2 values.

 

ConcatenateIDandREF = SELECTEDVALUE(table1[CASE ID]) &" : "& SELECTEDVALUE(table1[CASE ID REF])

This will return "2 : 1" if you filter on CASE ID = 2. 

Community Support Team
Community Support Team

Re: DAX - Return 2 rows of a column with a lookup

@wayers 

 

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Tricky-Slicer-Options/m-p/573381#M270846

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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 50 members 1,192 guests
Please welcome our newest community members: