Forum Discussion

Rustami4's avatar
Rustami4
Helper II
8 years ago

Filter measure

Guys, tell me please how does the formula for FILTER look? Can't understand how it works. I need to filter the count of the definite indicator from the column. 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    If you use calculate in conjunction with a filter it is fairly straightforward e.g.

     

    Calculate (<Calculation>, Filter( <table to filter>, <logic to filter the table>))

     

    I'm not sure sure from your post exactly what youre trying to achieve however.

     

    Thanks,

     

    Will

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Rustami4,

     

    Could you please post a sample of you data in TEXT mode? An example is an easy way to understand how Filter will work. Usually, Filter will work with Calculate that is used to change the evaluation context of a formula. 

     

    For example, this measure is quite sample. It will return the number of 'Product'[Color].

    Measure =
    COUNT ( 'Product'[Color] )

    But this formula will return the number of red of 'Product'[Color] only.

    MeasureWithFilter =
    CALCULATE (
        COUNT ( 'Product'[Color] ),
        FILTER ( 'Product', 'Product'[Color] = "Red" )
    )

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Rustami4,

     

    Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

     

    Best Regards!
    Dale