Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
trying to compare the multiple columns to find item available and item not avaialbe
Itemcode Reference Bom Itemcode Bom Description
1011 FZ FZ TearTap
1022 GH GH Printed
1033 KL item not required - BOM
1044 VB Bundlepaer
1055 CB CB Case lable
i am trying to compare if both reference bom and Itemcode bom values are same its return Item Available .
If refernce bom and itemcode bom values are not match its return Item not available .'
another condition if refence bom and itemcode bom values not match or blank same time description column if word contain item not required its return No issues.
Expected output :
Itemcode Reference Bom Itemcode Bom Description Status
1011 FZ FZ TearTap Item available
1022 GH GH Printed Item available
1033 KL item not required - BOM No issues
1044 VB Bundlepaer Item Not available
1055 CB CB Case lable Item available .
Looking for support .thanks in advance .
Solved! Go to Solution.
hi @Anonymous try it colum
Status =
SWITCH(
TRUE(),
[Reference Bom] = [Itemcode Bom], "Item available",
AND( [Itemcode Bom] = BLANK(), [Description] = "item not required - BOM"), "No issues",
AND( [Reference Bom] <> BLANK(), [Itemcode Bom] = BLANK()), "Item Not available")
hi @Anonymous try it colum
Status =
SWITCH(
TRUE(),
[Reference Bom] = [Itemcode Bom], "Item available",
AND( [Itemcode Bom] = BLANK(), [Description] = "item not required - BOM"), "No issues",
AND( [Reference Bom] <> BLANK(), [Itemcode Bom] = BLANK()), "Item Not available")
Hi @Anonymous
This is best done in Power Query. Place the following M code in a blank query to see the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwNFTSUXKLghEhqYlFIYkFSrE6IEkjI6CQuweMCCjKzCtJTYFKGhsDhbx9gAQQZZak5irk5ZcoFKUWlmYWpaYo6Co4+ftClZqYAJWEOUGUOpXmpeSkFiSmFkFlTU2Bos5OcCKxOFUhJzEpJ1UpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Itemcode = _t, #"Reference Bom" = _t, #"Itemcode Bom" = _t, Description = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Itemcode", Int64.Type}, {"Reference Bom", type text}, {"Itemcode Bom", type text}, {"Description", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Status", each if [Reference Bom] = [Itemcode Bom] then "Item available" else if Text.Contains(Text.Upper([Description]), Text.Upper("item not required")) then "No issues" else "Item not available", type text)
in
#"Added Custom"
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi,
Here is one way to do this:
Edit:
If you want to check for blank in the first case you can modify the dax like this:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |