Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
THENNA_41
Post Partisan
Post Partisan

Compare the value multiple column

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 . 

1 ACCEPTED SOLUTION
DimaMD
Solution Sage
Solution Sage

hi @THENNA_41 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")

Screenshot_29.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

6 REPLIES 6
DimaMD
Solution Sage
Solution Sage

hi @THENNA_41 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")

Screenshot_29.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

@DimaMD  Thank you so much its working 

AlB
Super User
Super User

Hi @THENNA_41 

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"

 

 

SU18_powerbi_badge

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.

 

@AlB Thank you so much for your reply 

ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

Measure 25 =

           
SWITCH(TRUE(),
        IF(IFERROR(
            SEARCH("item not required - BOM",MAX('Table (15)'[Description])),FALSE())=1,TRUE()),"No Issues",
MAX('Table (15)'[Itemcode Bom])=MAX('Table (15)'[Reference Bom]),"Item Available",
MAX('Table (15)'[Itemcode Bom])<>MAX('Table (15)'[Reference Bom]),"Item not Available")


End result:
ValtteriN_0-1673339520648.png

Edit:

If you want to check for blank in the first case you can modify the dax like this:

Measure 25 =
SWITCH(TRUE(),
        AND(IF(IFERROR(
            SEARCH("item not required - BOM",MAX('Table (15)'[Description])),FALSE())=1,TRUE()),
            ISBLANK(MAX('Table (15)'[Itemcode Bom]))),
            "No Issues",
MAX('Table (15)'[Itemcode Bom])=MAX('Table (15)'[Reference Bom]),"Item Available",
MAX('Table (15)'[Itemcode Bom])<>MAX('Table (15)'[Reference Bom]),"Item not Available")


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/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ValtteriN  Thank you so much for reply 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.