Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

custom column search

Can you help me with measure or custom column. Not sure which is easier.

tablea

id   name   order date    ship date   order_desc        custom_desc 

1     john       7/1/2023    7/3/2023      bike, boat                         

2     mary       7/2/2023    7/2/2023      boat                                         

3      tim          7/4/2023    7/5/2023     bike

4       sarah      7/6/2023 7/7/2023        car, boat

 

Not sure which is better. output custom column or  Measure

i want to search order_desc for bike and not boat

I will want to see all bike and also all boats

custom_desc

bike

boat

 

 

7 Replies

  • Anonymous what do you want in the custom_desc column?

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

    • Anonymous's avatar
      Anonymous
      Not applicable

      I want to search and pull both but separate them

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    something like

    if order_desc contains  bike and not boat then 'bike only'

    else bike

     

     

  • Anonymous you have to be clear in your requirement, what when there is a car and boat (last record in your example)? 

     

    People here are helping here each other and spending their time, the more clear you are in your requirement, the better it is.

    • Anonymous's avatar
      Anonymous
      Not applicable

       when there is a car and boat i want boat

    • Anonymous's avatar
      Anonymous
      Not applicable

      id   name   order date    ship date   order_desc

      1 john      7/1/2023    7/3/2023         bike, boat

      2 mary     7/2/2023    7/2/2023          boat

      3 tim        7/4/2023   7/5/2023           bike

      4 sarah    7/6/2023    7/7/2023           car


      if Text.Contains [Order-Desc],"Boat") & not Bike then "only boat"
      else
      if Text.Contains [Order-Desc],"Boat") then "only Boat"
      else
      if Text.Contains [Order-Desc],"bike")  then "Bike"

       

      when i drill down i want to also be able to say they are people with boat and bike.

  • foodd's avatar
    foodd
    Community Champion

    Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

    https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

    This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.