Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Finding a minimum value with a filter application

I am trying to write a measure that finds me the lowest value from a specific set of locations, I am having trouble with how to include a filter in my expression. For example, I have a table with 50 locations, and they are filtered into two seperate tables. I need two measures that can locate the smallest (and largest) values from each group and present them in a card. Thanks.

  • Hi, Anonymous ;

    I am not very sure whether understand your table structure correctly. and base on my understand ,i create a simple example as follows:

    1.enter table as a fiter(slicer)

    2.create a measure .

    min = IF(MAX([Group])="locations  1",MIN(Table1[values]),IF(MAX([Group])="locations  2",MIN(Table2[values])))

    The final output is shown below:

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    it's always helpful if you give an example how your data looks like. Now I can just guess.

    If you want to get the minimum from 2 different tables you can use the MIN function:

    Min Location = MIN( Table1[LocationColumn], Table2[LocationColumn] )

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the quick response. Perhaps I did not explain my question fully.

       

      Lets say I have one master table that contains a column with 50 restaurant locations, and a column with 200 values that show profit  for last year (4 entries per location, with 1 value each quarter). I have one table in my actual working page that contains half of the locations (based on size) and 100 entries. If I do a MIN function for just these 25 locations, the smaller locations still show up. I want to perform a MIN function along with the filter I used to separete the locations. Thanks

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    I am not very sure whether understand your table structure correctly. and base on my understand ,i create a simple example as follows:

    1.enter table as a fiter(slicer)

    2.create a measure .

    min = IF(MAX([Group])="locations  1",MIN(Table1[values]),IF(MAX([Group])="locations  2",MIN(Table2[values])))

    The final output is shown below:

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.