cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Return values related to selected ones

Hi all,

 

I have this datasource:

 

keyItem NumberProject IDProject Due Date
0948RCN-026202352
1937RCN-026202352
2801RCN-026202352
3302BJS-682202238
4143BJS-682202238
5989BJS-682202238
6791PPT-112202352
7702PPT-112202352
8476PPT-112202352
9446PPT-112202352

 

I have a slicer to select some project IDs

 

I want to have two text boxes: one to display all the project IDs selected, one to dislpay the related due date FOR EACH project.

 

I use this formula to display the projects:

 

 

selectedProjects = CONCATENATEX(VALUES(Table[Project ID]), [Project ID], UNICHAR(10))

 

 

 

And this one to display the due dates:

 

 

dueDate = CONCATENATEX(VALUES(Table[Project Due Date]), [Project Due Date], UNICHAR(10))

 

 

I obtain this:

Annotation 2022-05-18 164648.png

 

 

 

 

 

 

But expected result is this:

arthurld_0-1652885621866.png

It has to be dynamic when I select other projects...

 

Anyone can help me on this?

 

Thanks a lot

arthurld

 

1 ACCEPTED SOLUTION
sturlaws
Super User
Super User

Hi, @Anonymous,

the reason you only get two dates with your current measure is because VALUES returns the distinct values of the argument.

 

Could you try to write your measure like this instead:

dueDate =
CONCATENATEX (
    ADDCOLUMNS (
        VALUES ( 'Table'[Project ID] ),
        "tmp", CALCULATE ( MIN ( 'Table'[project due date] ) )
    ),
    [tmp],
    UNICHAR ( 10 )
)

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

View solution in original post

1 REPLY 1
sturlaws
Super User
Super User

Hi, @Anonymous,

the reason you only get two dates with your current measure is because VALUES returns the distinct values of the argument.

 

Could you try to write your measure like this instead:

dueDate =
CONCATENATEX (
    ADDCOLUMNS (
        VALUES ( 'Table'[Project ID] ),
        "tmp", CALCULATE ( MIN ( 'Table'[project due date] ) )
    ),
    [tmp],
    UNICHAR ( 10 )
)

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.