Forum Discussion
Add Column Apply to Each Row with Multiple Criteria
- Anonymous1 year ago
Hi,
Thanks for the solution ToddChitt offered, and i want to offer some more information for user to refer to.
hello Spudonis , you can create a calculated column.
Column = VAR a = SUMMARIZE ( FILTER ( 'Table', CONTAINSSTRING ( [Plan Name], "Fiber" ) ), [Customer ID] ) RETURN IF ( [Customer ID] IN a, "Y", "N" )Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Investigate the following DAX functions: FILTER, SEARCH, and SELECTCOLUMNS.
SELECTCOLUMNS allows you to create a table using specific columns from another table. That 'table' can be a FILTER statement, and that FILTER statement can use the SEARCH function to look for "Fiber" in the appropriate field.
The SEARCH will return the ordinal position of the search term, if it exists.
Now use the FILTER to return only a set of rows where the SEARCH results in not null.
Use SELECTCOLUMNS to get the Customer ID from the result of the FILTER statement.
My Fiber Customers = SELECTCOLUMNS( FILTER ( [Customers], (IF( SEARCH ( "Fiber", [Plan Name], 1, BLANK() ) ) >= 1, [Customer ID], "Fiber Customer ID" )
(sorry not sure of the exact DAX syntax here)
The end result will be a table of Customers that have "Fiber" as a part of the Plan Name. Join that to the table you have on Customer ID, and set up an IF statement using RELATED.:
The calculated column could be:
[Fiber] = IF ( ISBLANK ( RELATED ( 'My Fiber Customers'[Fiber Customer ID] ) ), "N", "Y" )
Hope that helps. Learn about those DAX funtions here:
I edited my initial post. Hopefully I've added some more clarity to what I'm after.