Forum Discussion

BEC_100's avatar
BEC_100
Frequent Visitor
3 years ago
Solved

Filter Items

Sorry for the basic question.  I am trying to learn the measure flow. I have a table that contains several items

PCB

PS

CABLES

COVER

LEDs

The following measure helps to identify the items

 

IF (CONTAINS(Installers,Installers[Product Name],"PCB"),"these are the pcb found","not pcb")

 

However, it displays all other “not pcb” items.  How do I display only the PCB items.

  • Hi , BEC_100 

    According to your description, you just want to show the data contains "PCB".

    Here are the steps you can refer to :

    (1)We can click "New Measure" to enter this:

    Flag = var _name =  MAX('Table'[Name])
    return
    IF( CONTAINSSTRING(_name,"PCB") ,1,0)

    (2)Then we can put the measure on the "Filter on this visual" and configure it and then we can meet your need:

     

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

4 Replies

  • Arul's avatar
    Arul
    Super User

    BEC_100 ,

    Could you explain it bit more in detail? Also, If possible please add the sample data.

    Thanks,

    Arul

  • BEC_100's avatar
    BEC_100
    Frequent Visitor

    yes, of course.

    What I get with the measure is 

    PCB375893These are the PCB found
    PS465Not pcb
    CABLES4567Not pcb
    PCB45786These are the PCB found
    LEDs8923Not pcb

     

    I would like to display only PCB items

    PCB375893These are the PCB found
    PCB 45786These are the PCB found

     

    many thanks

  • Make the following change

    Before:
    IF (CONTAINS(Installers,Installers[Product Name],"PCB"),"these are the pcb found","not pcb")
    
    After:
    IF (CONTAINS(Installers,Installers[Product Name],"PCB"),"these are the pcb found")
  • Hi , BEC_100 

    According to your description, you just want to show the data contains "PCB".

    Here are the steps you can refer to :

    (1)We can click "New Measure" to enter this:

    Flag = var _name =  MAX('Table'[Name])
    return
    IF( CONTAINSSTRING(_name,"PCB") ,1,0)

    (2)Then we can put the measure on the "Filter on this visual" and configure it and then we can meet your need:

     

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly