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
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

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.