Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Does anyone have any ideas on how I can accomplish the following task?
I have a list of sites and need to find the name of the site in a text field and, if found, retrieve its name.
I used a formula, but it slowed down processing.
Does anyone have any suggestions?
List in the List table.
The rawdata table has a description field where I will search for the name of the device from the list.
I am using this formula:
Solved! Go to Solution.
@vqps8866 That doesn't look right, CONTAINSSTRING takes 2 text parameters not a text parameter and a table. If you can provide sample data as text, this would be easier but maybe something like the following:
Device Name (Column?) =
VAR __ListaSites = DISTINCT( 'List'[List] )
VAR __Descricao = [Description]
VAR __Resultado =
MAXX(
FILTER(
ADDCOLUMNS(
__ListaSites,
"__Found", CONTAINSSTRING( [List], __Descricao )
),
[__Found] = TRUE()
),
[List]
)
VAR __Result = IF( __Resultado = BLANK(), "REQ", __Resultado )
RETURN
__Result
Hello Greg,
Your formula worked perfectly.
Thank you very much for your help.
Hello
How are you?
What happens is that I have a list of 3,000 site names and I need to look in a field called description, which contains various data and the site name as well.
I need to find which website name is in the field and write down the name that was found.
I even thought of something like this, but there are 3,000 names:
SWITCH(
TRUE(),
CONTAINSSTRING([device name], “AR-ACA-API-001”), “AR-ACA-API-001”,
CONTAINSSTRING([device name], “AR-AME-DISP”), “AR-AME-DISP”,
....
I am using another one but the processing time is too long:
Hi @vqps8866,
Thank you for clarifying the requirement. Given that you have about 3,000 site names, using SWITCH or checking each row with CONTAINSSTRING would be quite inefficient. Instead, you can try a more efficient method with MAXX and ADDCOLUMNS to dynamically check for matches.
Device Name =
VAR __ListaSites = DISTINCT('List'[List])
VAR __Descricao = [Description]
VAR __Resultado =
MAXX(
FILTER(
ADDCOLUMNS(
__ListaSites,
"__Found", CONTAINSSTRING(__Descricao, [List])
),
[__Found] = TRUE()
),
[List]
)
RETURN IF(ISBLANK(__Resultado), "REQ", __Resultado)
Thank you.
Hi @vqps8866 , Could you please eloborate a little and also help with sample column or data. Please try below formula if it works for you:
Device Name =VAR Descricao = RawData[Description]RETURNCOALESCE (CALCULATE (FIRSTNONBLANK ( List[List], 1 ),FILTER (List,CONTAINSSTRING ( Descricao, List[List] ))),"REQ")
Thanks,
Azad Singh Thakur
Power BI Enthusiast | LinkedIn: https://www.linkedin.com/in/thakurazad/
@vqps8866 That doesn't look right, CONTAINSSTRING takes 2 text parameters not a text parameter and a table. If you can provide sample data as text, this would be easier but maybe something like the following:
Device Name (Column?) =
VAR __ListaSites = DISTINCT( 'List'[List] )
VAR __Descricao = [Description]
VAR __Resultado =
MAXX(
FILTER(
ADDCOLUMNS(
__ListaSites,
"__Found", CONTAINSSTRING( [List], __Descricao )
),
[__Found] = TRUE()
),
[List]
)
VAR __Result = IF( __Resultado = BLANK(), "REQ", __Resultado )
RETURN
__Result
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |