Forum Discussion

numaan_99's avatar
numaan_99
Frequent Visitor
2 years ago
Solved

calculating unique count based on a filtered condition

i have three columns "term_id_new", "Sale Date" from the same table "Sale Items". Now i want to keep only those "term_id_new" whose first "Sale Date" is 20/12/2023. How to do that in powerbi
 
sample data: 
term_id_newSale Date
BBTN0100111/26/2023
BBTN0100112/1/2023
BBTN0100112/3/2023
BBTN0100112/5/2023
PBTN0100112/20/2023
PBTN010019/1/2023
PBTN010019/1/2023
PBTN010019/1/2023
PBTN010019/1/2023
LTTN0100112/20/2023
LTTN010019/2/2023
LTTN010019/3/2023
LTTN010019/8/2023

Expected Output:

term_id_newSale Date
PBTN0100112/20/2023
LTTN0100112/20/2023
 
 
NOTE: please provide me the detailed solution along with the formulae as i am completely noob into powerbi. Please do this for me. I will pray for you.
  • Hii numaan_99,
    Based on my understanding, I found the solution below

    Try this,

     

    1. Minimum of sael date for each Term_id:

     

    2. Terminal Id for the last date 20/12/2023:

     

    Did I answer your question?

    Mark my post as a solution, this will help others...!

    Hit the kudo also,

    Thank you.

     

     

     

7 Replies

  • Hii numaan_99 

    Use the below dax:

    Count = Count(('Table (4)'[Term_id]))
     

    Did I answer your question?

    Mark my post as a solution, this will help others...!

    Hit the kudo also,

    Thank you

    • numaan_99's avatar
      numaan_99
      Frequent Visitor

      but i need to find out minimum of "sale date" for each terminal id. then out of those, i only need to keep terminals IDs whose last date is 20/12/2023. i need to create a separate column for this. and using that column, i will do some calculations in future. please provide me any queiry formulas in detail.

      • Vallirajap's avatar
        Vallirajap
        Icon for Resolver III rankResolver III

        Hii numaan_99,
        Based on my understanding, I found the solution below

        Try this,

         

        1. Minimum of sael date for each Term_id:

         

        2. Terminal Id for the last date 20/12/2023:

         

        Did I answer your question?

        Mark my post as a solution, this will help others...!

        Hit the kudo also,

        Thank you.

         

         

         

    • numaan_99's avatar
      numaan_99
      Frequent Visitor

      but i need to find out minimum of "sale date" for each terminal id. then out of those, i only need to keep terminals IDs whose last date is 20/12/2023. i need to create a separate column for this. and using that column, i will do some calculations in future. please provide me any queiry formulas in detail.