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

concatenatex

Hi,

 

Looking for advice or a solution...

 

Imagine example

 

ProgramProjectNameOrderOnly ifWanted Result Column
AQBob1TRUEBob
Ryan
BWJames2TRUEJames
John
CETom4FALSEN/A
ARRyan3TRUEBob
Ryan
ATJohn5FALSEN/A
BYJohn5TRUEJames
John
CURyan3FALSEN/A


The wanted result is basically

Per project which has an associated program I want the names in the result column, with a line break, if the row has a true, with the results ordered by the order column. If the row has a false I want the result to display N/A

 

The formula I have tried, which does part of the solution, is CONCATENATEX(This table, Name, unichar(10), Order, ASC) as a measure.

 

This formula doesn't account for the only if so in each line the answer if produced. I have tried to use if("Only if"=TRUE then ....) but only as a custom column which isn't working and I can't do it as a measure. I also can't use a conditional column because I can't use a formula to give me the answer.

 

Thanks.

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @pd4000,

Based on my test, you can refer to below steps:

1.I have entered some sample data:

L.PNG

2.Create a calculated column and a measure:

Calculated column:

Filter Name = IF('Table1'[Only if]="TRUE",[Name],BLANK())

Measure: F = IF(MAX('Table1'[Only if])="TRUE",

LEFT(CONCATENATEX(ALL(Table1), 'Table1'[Filter Name],UNICHAR(10),'Table1'[Program]=MAX('Table1'[Program]),DESC),10),"N/A")

 

3.Create a table measure add the related fields and you can see the result.

LL.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/y2j8rdhgtjuhmuy/concatenatex.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
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
v-danhe-msft
Employee
Employee

Hi @pd4000,

Based on my test, you can refer to below steps:

1.I have entered some sample data:

L.PNG

2.Create a calculated column and a measure:

Calculated column:

Filter Name = IF('Table1'[Only if]="TRUE",[Name],BLANK())

Measure: F = IF(MAX('Table1'[Only if])="TRUE",

LEFT(CONCATENATEX(ALL(Table1), 'Table1'[Filter Name],UNICHAR(10),'Table1'[Program]=MAX('Table1'[Program]),DESC),10),"N/A")

 

3.Create a table measure add the related fields and you can see the result.

LL.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/y2j8rdhgtjuhmuy/concatenatex.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Daniel,

 

Thanks very much for your response! Unfortunately, it didn't quite work but it did place the N/As in the boxes that I wanted. I played around a bit with CONCATENATEX and some of your formula for the measure and I got one that solved it!

 

Basically, I had

 

Measure = if(max(table1[only if])="TRUE", CONCATENATEX(table1 , table1[name], UNICHAR(10), table1[order], ASC), "N/A")

 

and that worked for me, so thank you very much for sending me your solution and linking the file, that was extremely helpful!

 

Kind regards,

 

Priyan

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.