Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
numaan_99
Frequent Visitor

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.
1 ACCEPTED SOLUTION

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

Try this,

 

1. Minimum of sael date for each Term_id:

Vallirajap_0-1703068422278.png

 

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

Vallirajap_1-1703068537338.png

 

Did I answer your question?

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

Hit the kudo also,

Thank you.

 

 

 

View solution in original post

7 REPLIES 7
Ahmedx
Super User
Super User

in this scenario you do not need any measures, the filter will do everything for you

 

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
Resolver III
Resolver III

Hii @numaan_99 

Use the below dax:

Count = Count(('Table (4)'[Term_id]))
 
Vallirajap_0-1703062864549.png

Did I answer your question?

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

Hit the kudo also,

Thank you

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.

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

Try this,

 

1. Minimum of sael date for each Term_id:

Vallirajap_0-1703068422278.png

 

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

Vallirajap_1-1703068537338.png

 

Did I answer your question?

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

Hit the kudo also,

Thank you.

 

 

 

This gives me the solution. i would like to work with you could you please give me your number or any contact to connect

Hii @numaan_99,

I am really happy about your acknowledgement. Thank you for that.

 

If you have any questions, mention me in your post to ask a question in the community.

 

In rare cases, connect with me through email.

pvalliraja21@gmail.com

 

Did I answer your question?

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

Hit the kudo also,

Thank you

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.