Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

filter a table

I HAVE THIS TABLE

Label        Data

A              20/10/2022

A              20/11/2022

A              10/12/2022

B              15/10/2022

B               25/11/2022

HOW TO FILTER THE TABLE TO GENERATE ANOTHER TABLE THAT ONLY HAS THE LABEL REGISTRATION WITH THE EARLIEST DATE

I WANT OBTAIN THE FOLLOWING TABLE

           

A              20/10/2022

B               15/10/2022

 

  • If you can do something with a measure, you should consider that before creating additional tables and/or columns. However, this expression should give you the table you need (update with your actual table name).

    New Table =
    SUMMARIZE ( TABLE, Table[Label], "MinDate", MIN ( Table[Data] ) )

    Pat

     

7 Replies

  • ppm1's avatar
    ppm1
    Solution Sage

    If you can do something with a measure, you should consider that before creating additional tables and/or columns. However, this expression should give you the table you need (update with your actual table name).

    New Table =
    SUMMARIZE ( TABLE, Table[Label], "MinDate", MIN ( Table[Data] ) )

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you for help

  • Anonymous 

     

     

    * If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I HAVE THOUSANDS OF LABELS I CAN“T USE A VARIABLE FOR EACH ONE. i NEED A MORE GENERIC SOLUTION THAT CREATE A NEW TABLE THAT I CAN WORK ON IT

  • AbbasG's avatar
    AbbasG
    Memorable Member

    Anonymous you can filter the date column by earliest as below to get your desired output.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I NEED TO CREATE A NEW TABLE TO DO CALCULATATIONS ON IT

      • Mahesh0016's avatar
        Mahesh0016
        Super User

        Anonymous 

        Try this one.... 

        Table 2 =
        CALCULATETABLE(SUMMARIZE(Filter_Tables,Filter_Tables[Label        ],"Date",FIRSTDATE(Filter_Tables[Data])))

        Note : Your Date is Asc order .

         

        *If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.