If contain in DAX - if-statement

I have a column which a couple of words about goods that are unique like (a pair of shoes, shoe, shoes) I want to create a new column and search for that column containing some words like this write Shoes in a new column. also, the text in the column is in Persian. How can I do it?
Hi, I have a column which a couple of words about goods that are unique like (a pair of shoes, shoe, shoes) I want to create a new column and search for that column containing some words like this write Shoes in a new column. also, the text in the column is in Persian. How can I do it?

Related

PowerApps get column names based on row data

I have a SharePoint list that I want to retrieve the column names from, based on the row value. The column names will then be matched against another SharePoint list.
In the below example I know the value of the Function column. Based on that, I want to know the column names of all columns where the checkbox in that row is checked.
I think I'm nearly there. I can filter the columns based on the job title and allowed values. The issue now is the "StartsWith". I want to filter the column names, but I don't know the name of the column to filter on. It has to loop trough all the columns. How do I do this?
Also I'm not sure if AllowedValues is the right way to filter the columns based on the value. Can someone verify this for me?
//Get job title
Set(selectedUserJobTitle, Office365Users.UserProfileV2(galleryDirectReports.Selected.userPrincipalName).jobTitle);
//Get questions starting with "Q", based on the selectedUserJobTitle and values being true
ClearCollect(colQuestions,
Sort(
Filter('Comp - Fuctions',
Function.Value = selectedUserJobTitle,
//TODO: Replace "Title" with actual column name
StartsWith(Title, "Q"),
AllowedValues = true
),
Title, Ascending
)
);

Create a new column based on condition

I want to create a new column based on conditions.
The table look like this
Table with two authors from UK
I want to create a new column author_uk and country_uk with UK values
Table with new coilumn

Count hyperlinks in power bi

I have a column named "body" and in this columns there many rows that contain hyperlinks in text.
is it possible in power bi to count if there is a hyperlink in text then create a new column that shows the number of hyperlink provided in the text or atleast show in a different column that this text contain hyperlinks. TA
You can add a Custom Column to count the number of occurrences of <a (note there is a space after a) in the body. You can do that using Text.PositionOf function by passing Occurrence.All parameter, so the formula used to create the column should be something like this:
= List.Count(Text.PositionOf([body], "<a ", Occurrence.All))
This will give you how many times <a appears in the body (which is the number of hyperlinks):

Split a column of lists into multiple columns in PowerBI

I have imported a JSON file into PowerBI and it contains a column in which the values are of type "List". I am looking to expand that column into multiple columns.
Specifically, the data contains a Sprint Name, the start date and the end date of the sprint, along with some other values associated with each sprint.
Trying to use "Expand to new rows" duplicates each sprint instance, creating a table that looks like this, duplicating each sprint instance multiple times for each associated value:
Sprint Name Value
JAN(S1Dev) 2019-01-01
JAN(S1Dev) 2019-01-13
JAN(S1Dev) {attribute}
JAN(S1Dev) {attribute}
JAN(S2Dev) 2019-01-14
JAN(S2Dev) 2019-01-31
JAN(S2Dev) {attribute}
JAN(S2Dev) {attribute}
FEB(S1Test) 2019-02-01
FEB(S1Test) 2019-02-15
... ...
I would like to do something similar to the "expand" feature, which instead creates a new column with each attribute rather than a new row. This is currently vastly increasing the size of my table for no reason, while also making the data practically un-useable. Any help would be appreciated, cheers!
I have found a very simple solution to this, but as it took me some time to figure it out I will answer my own question instead of deleting it to help others in the future...
Upon importing the JSON data into PowerBI first select "Convert to Table" to view the data as a table with editable properties.
Next, click the arrows pointing away from each other at the top of the column of Lists, and select "Extract Values".
Select a delimiter to use for concatenating values, I am choosing a comma since I know that the data contained within the list does not have any commas in it. If your data contains commas within it, choose something else. Similarly, if your data contains one of the delimiters, do not choose that as the delimiter.
It should now display a comma-separated list where it previously displayed "List" in orange text.
Now, right-click on the column and select "Split Column" then choose "By Delimiter"
Select the delimiter that you previously chose, and under "split at" select "Each occurrence of the delimiter" then click OK.
Your column should now be split into multiple columns based on the list!

Searching for unmatched ntheames when comparing spreadsheets

In one spreadsheet I have 3 columns with a first and last name of a person combined. In the 2nd spreadsheet, I have column a = first name and column b = last name.
I want to know which names in spreadsheet one cannot be found in spreadsheet two. I also need to verify the data to make sure that the formula was accurate on finding the correct lookup.
Do I have to combine my columns in spreadsheet 2 to make the first and last name in the same column to make this work?
Which formula would you use for either scenario?
Use this:
=ISNA(MATCH($A1&" "&$B1,Sheet2!$A:$A,FALSE)))
Where (in order):
A1 is the first name column in Sheet1
B1 is the last name column in Sheet1
Sheet2 is the sheet that has the data stored as names separately
$A:$A is the rows that have the two names together
FALSE is because it's an exact match
This will return FALSE if the element does not exist, and TRUE if it does
You can also use:
=VLOOKUP($A1&" "&$B1,Sheet2!$A:$D,3,FALSE)
If you want to retrieve data for a match.
Finally, if you need to do your lookups the other way, take a look at this thread for some ideas on how to split the string into two pieces.