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

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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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
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.