containsstring
10 TopicsFind multiple substring DAX CONTAINSSTRING
Hello everyone, I need to find if the substrings "house", "home", "dewelling" appear in a long string column. Using CONTAINSSTRING I am able to find each word at a time- house= CONTAINSSTRING(table1[column1], "house"). Is there a way to look for more than one substring? Perhaps something like house= CONTAINSSTRING(table1[column1], "house" or "home" or "dewelling"). Thank you for any help!Solved60KViews0likes14CommentsFilter rows if they contain at least one value from a text array
I'm trying to show total sales for a products, witch name string contains at least one of the keywords from a static table. Here is the formula for it: Sales by Group, EUR = CALCULATE ( [Sales, EUR], FILTER ( 'Sales Product Lookup', CONTAINSSTRING( 'Sales Product Lookup'[Product Name], MAX('Table Keywords'[Keyword]) ))) For now it's pretty useless and only works for visuals in the form of a table where one of the columns = Table Keywords'[Keyword]. How can I force the CONTAINSSTRING function to accept array/column instead of single value? Will be realy appreciate for the help!773Views0likes2CommentsCONTAINSSTRING in EVALUATE error
Hey guys. I'm trying to pull data from SSAS in Import mode using DAX Query. But having trouble with CONTAINSSTRING in EVALUATE statement. No matter how I change it, it gives me error every time. EVALUATE FILTER( ALL( 'Task'[appointment_type] ), CONTAINSSTRING( [appointment_type], "Callcenter" ) ) The error I get is following: DataSource.Error: AnalysisServices: Query (4, 5) Failed to resolve name 'CONTAINSSTRING'. It is not a valid table, variable, or function name. Any ideas? IN operator also doesn't seem to work in EVALUATE statement.Solved1.6KViews0likes6CommentsMeasure based on looking for a string inside another string
Hi everyone! I'm working with sports data and would like to know if there is any way to find a string inside a column (also a string) filtered for a third column. For example, the one below: - To find the Player column (from Player table) inside the FiveOnCourt column (from Plays table) based on Full_Game column. The goal is to get how many games one player played (every game has a different value in Full_Game column). Secondly, I would like to know if, filtering for the MAX of Índice column + a Full_Game (to do the search in a game), it's possible to do the same exercise [To find the Player column (from Player table) inside the FiveOnCourt column (from Plays table) based on Full_Game column. The goal is to get how many games one player played.]. The goal here is to know if a player started the game. If the string (Player) is in FiveOnCourt field, there would be yes and a starting five player, otherwise, the Player would not be in Starting Five. Add you the pbix file and raw data: https://drive.google.com/drive/folders/1BxVWCtoHkcQYnDfOpqmYFpFgXpoEIPOt Thank you for your time.249Views0likes0CommentsHelp with filtering table based on filter string
I hope someone can help with this problem. So I'm trying to create a DAX measure, that needs to filter some account numbers in a table based on a string. The string contains both ranges and specific account numbers, and looks like this: 01011..01090|01901..01902|01904..01959|01980..01998 I can then fetch that value in my measure with this variable: VAR FilterString = CALCULATE( SELECTEDVALUE( 'Account Schedule'[Totaling]), 'Account Schedule'[Row No_] = "01090" ) However, how do i then translate that string into a useable filter?773Views0likes5CommentsFilter table by string from another table
Hello, my friends. Tenho a seguinte situação. Na tabela 1 tenho uma coluna com números de contrato (1000, 1001, 1002, 1003, n) Na tabela 2 tenho uma tabela de fornecedores que podem atender vários contratos. Nesta tabela há uma coluna com os números de contratos atendidos, porém os números estão inseridos da seguinte forma em cada célula: 1000; 1003 (separados por ponto e vírgula). Preciso inserir uma segmentação de dados pelo número do contrato (da tabela 1), e que esta consiga filtrar a tabela 2 que contém os dados aglutinados com ponto e vírgula (algo como uma CONTAINSTRING) Alguém consegue me auxiliar nesta missão?Solved1.1KViews0likes2CommentsCount appearance of string in a comma-separated data column does not count values after the first co
I have two tables: Products table has a single column with one product per field: List table has several columns but the column I'm interested in has fields that can have as little as one product to as much as 17, all separated with a comma and no spaces in between: The issue I'm facing and need help with is to correctly count each product either, ideally as as a measure. I tried two measures but they both gave me an incorrect count of blanks; there are no blank values either table. What I found is that both measures count only the *first* value they find in the List column and then continue counting subsequent rows: How can I correctly count all values in each field from the List table and have zero "blank" counts? Thanks!Solved3.7KViews0likes7CommentsFiltering to columns that contain a certain string, & only on and after a given date
Hi community, I was given help months ago to come up with a script; it's been working wonderfully. I now need to expand it. This is how it looks currently: CALCULATETABLE ( ADDCOLUMNS ( SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ), "Cost-per-day", CALCULATE( SUM(('CM360'[impressions])) / 1000) * 4 ), 'CM360'[site_cm360] = "Programmatic Ads" ) --------------------------------------------------------------------------------------------------------------------------------- You can see we've created a calculated table where we've taken the [Date] and [Placement ID] columns from an existing table, 'CM360'. We've then created another column, "Cost-per-day", calculated by taking [impressions], dividing that by 1000, then multiplying by 4 dollars. Only where the column, 'CM360'[site_cm360], contains "Programmatic Ads". I would now like to expand that script to something like this: CALCULATETABLE ( ADDCOLUMNS ( FILTER ( 'CM360', (CONTAINSSTRING('CM360' ['Placement'], “banner”)), 'CM360'[Date] >= 01/09/2022 ), SUMMARIZE ( 'CM360', 'CM360'[Date], 'CM360'[Placement ID] ), "Cost-per-day", CALCULATE( SUM(('CM360'[impressions])) / 1000) * 5.00 ), 'CM360'[site_cm360] = "Programmatic Ads" OR “iAgency” ) I wish to filter what we were doing before to rows where 'CM360' ['Placement'] column contains the string "banner". And only where those rows have the date on or after September 1st 2022. Additionally, in that last line, I wish to expand it so it now looks for those two different values in the column, 'CM360'[site_cm360] Please can you look at my expanded script and help me understand how you would write it because I don't think this is how it should be written in DAX. thank-you 🙂Solved1.6KViews0likes3CommentsCombing TREATAS, COTAINSSTRING and CONCATENATEX issue (Icon Map)
Hi all, I have quite a bespoke issue that I can seem to find a resolution for (either by my own working or by searching online). I have a column of data in one table that has a corresponding strings such as bellow: Legend NO2 Cat 19-22 40-44 19-22 34-37 19-22,28-31,40-43 You'll note that in the last entry, multiple caterogries are included as the object encompasses multiple catergories. I have a second table (which is actually more of a legend as this is being used for a map) with the same list of corresponding catergories. The idea is that when someone clicks a catergory, or multiple catergories, within that table, it will filter the table above. Because of some quite deep complexeties with the Icon Map visualisation I am using, I cannot use a direct relationship so I have to use TREATAS. I have come up with a DAX that almost gets me where I need to be and is as follows and uses a CONCATENATEX on the fitlering table to create a single object (as Icon Map does not like tables of multiple values) (legendcheck2 is the filtering context and SNAMaster is the primary dataset)(ignore the switch): Value = SWITCH('Measures Table'[SelectionMeasure],1,CALCULATE(SELECTEDVALUE(SNAMaster[NO2_mean]), TREATAS(SUMMARIZE(FILTER(SNAMaster (CONTAINSSTRING(CONCATENATEX(VALUES(legendcheck2[CAT]),legendcheck2[CAT],","), VALUES(SNAMaster[Legend NO2 Cat])))),SNAMaster[Legend NO2 Cat]),SNAMaster[Legend NO2 Cat]))) This allows the last object in the table to be included but only when all of the catergories listed are selected. So for example, as long as 19-22,28-31,40-43 are within the selection criteria, the object will show. However, if for example I wanted to select just 19-22, the object will not appear. I understand why this is, because it cannot find the string as intended, but I am at a loss for how to resolve this issue so that the object will remain active when filtered by any combination of values selected. So that, for example, if I have 19-22 and 40-43 selected, the object will remain active. Am I missing something obvious here or should I be trying something entirley different? Any help would be greatly appreciated!730Views0likes1CommentCONFUSED WITH USING CONTAINS, CONTAINSSTRING NEED HELP!
Hi guys, all I want to do is simply count all sales orders that contains at least 1 of the products for a selected order. My forumla is shown below. Essentially just confused on how to use contains or containsstring to essentially search for shared values. Any help would be appreciated !Solved1.5KViews0likes4Comments