Data Model - Formula not working

michael8000

New Member
Joined
Mar 10, 2014
Messages
27
I'm trying to pull out a specific word from my Data Model. I added a new column and this formula works in regular excel but not in the Data Model. Anyone have any ideas why its not working?

My goal is to have only single word "Adobe" on the type column (type column was just added)

1575577653040.png

1575577750545.png

1575577783728.png
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,836
or
CustomColumn = IF(ISERROR(SEARCH("Adobe", TableName[ColumnName])),"X","Y")
 

michael8000

New Member
Joined
Mar 10, 2014
Messages
27
I've never used "Contains" but it is asking for a Table but it won't let me add a table???
 

michael8000

New Member
Joined
Mar 10, 2014
Messages
27
That is just adding Adobe to ALL rows, even when it does not have the word "Adobe" in the cell it's searching against

1575583270899.png

1575583281346.png
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,836
CONTAINS doesn't work unfortunately :(
if you want to try start typing =IF(CONTAINS( and select table name from the dropdown list

Edit:
I am too slow or you are too fast :)
try post#4 or maybe use PowerQuery instead of DataModel?
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,836
PowerQuery - M-code, eg. = Table.AddColumn(Type, "Custom", each if Text.Contains([Item], "Apple") then "Apple" else "Misc")
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,836
with DAX:
Column = IF(CONTAINSSTRING([Item],"Apple"),"X","Z")
ItemSale PriceDate SoldColumn
Apple305/03/2017X
Orange512/05/2018Z
Apple711/04/2017X
Orange430/06/2018Z
Banana405/04/2019Z
Pear631/07/2019Z
Banana511/05/2019Z


but be aware CONTAINSSTRING function is available in newer version, so try PowerBI
 

citizenbh

Board Regular
Joined
Sep 19, 2013
Messages
123
Code:
=IF(IFERROR(SEARCH("Adobe", [Vulnerability Title]),-1)=1,"Adobe","Misc")
 

Forum statistics

Threads
1,082,367
Messages
5,365,028
Members
400,819
Latest member
Gossow

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top