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
SebastianAlmer
Frequent Visitor

Need help: Concatenate Text grouped by site, selected by date

Hi,

I want to concatenate some text according to a specific date and group by a specific project-

The tables:

 

Personnel

PNRFirstnameLastnameShortname (calculated)
1HansMeierMeier, H
2PeterHuberHuber, P
3FrankSchulzSchulz, F
4MarthaDoeDoe, M

 

Shortname = Personnel[Lastname] & ", " & LEFT(Personnel[Firstname],1)

 

PNR_Projects

PNRDateProject
101.01.20214711
201.01.20214712
301.01.20214713
401.01.20214711
102.01.20214715
302.01.20214711
402.01.20214711
103.01.20214712
403.01.20214715
304.01.20214714

 

Projects:

 

Project_NumberProject_Name
4711Construction Site A
4712Highway XY
4713Building AB
4714Project Whatever
4715Site Whereever

 

Of course I can create a matrix, where I filter all by a date slicer and group by project.

this would be something like:
Screenshot 2021-02-01 153841.png

I want a more condensed view: How can I concatenate all Shortnames in one line?
I would like to have something like:

Construction Site A:
Doe, M | Schulz, F | ....

Site Whatever:
Meier, H | ...

So all Names on a specific Date grouped by Proejct, concatenated with a separator like " | "

any ideas? The quick measure "concatenate" leads to sam weird result:

Screenshot 2021-02-01 154304.png

Thanks in advance for your help

1 ACCEPTED SOLUTION
Payeras_BI
Super User
Super User

Hi @SebastianAlmer ,

Something like this:

Payeras_BI_0-1612194483654.png

CONCATENATED SHORT NAMES =
CALCULATE (
    CONCATENATEX (
        VALUES ( Personnel[Shortname (calculated)] );
        Personnel[Shortname (calculated)];
        "|"
    );
    CROSSFILTER ( Personnel[PNR]; PNR_Projects[PNR]; BOTH )
)

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

4 REPLIES 4
Payeras_BI
Super User
Super User

Hi @SebastianAlmer ,

Something like this:

Payeras_BI_0-1612194483654.png

CONCATENATED SHORT NAMES =
CALCULATE (
    CONCATENATEX (
        VALUES ( Personnel[Shortname (calculated)] );
        Personnel[Shortname (calculated)];
        "|"
    );
    CROSSFILTER ( Personnel[PNR]; PNR_Projects[PNR]; BOTH )
)

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
SebastianAlmer
Frequent Visitor

I might have found some additional information: If I change the relation between Table "Personnel" and "PNR_Projects" to cross filter both, than it seems to work here. But can't do as it shredders some other visuals I need. Is there any option to concatenate text based on a filter or a changed relationship only for this visual with cross filter both?

Greg_Deckler
Super User
Super User

@SebastianAlmer - You should be able to create a measure that uses CONCATENATEX to concatenate all of the names together.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thanks for your fast response. That leads to exakt this strange behaviour as you can see in the last screenshot. It puts together all names, not only those relevant for the specific project

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.