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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
KyawMyoTun
Helper IV
Helper IV

Summarize based on ID and Name with Min Date of Entire Dataset

Dear Experts,

  I am trying to summarize the columns based on ID and Name with Min Date.
Here is my data,

IDNameDate
1111KMT6/1/2023
1111KMT6/2/2023
1112MMT6/2/2023
1112KKT6/2/2023

I tried with the summarize function as below dax

Ticket =
COUNTROWS(SUMMARIZE(Sheet1,Sheet1[ID],Sheet1[Name],"Min Dt", MIN(Sheet1[Date])))
As ID 1111 and Name KMT is duplicate, I would like to count as only 1 at the 6/1/2023(do not want to count at 6/2/2023).
So, my expected result will be,
Day Total Count
6/1/2023 1

6/2/2023              2
even after selecting from slicer.
Please help me to correct my dax funtion.

Regards,
KMT

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @KyawMyoTun You can use the following DAX expression

 

Ticket =
COUNTROWS(
SUMMARIZE(
FILTER(
Sheet1,
[Date] = CALCULATE(
MIN(Sheet1[Date]),
ALLEXCEPT(Sheet1, Sheet1[ID], Sheet1[Name])
)
),
Sheet1[ID],
Sheet1[Name],
"Min Dt", MIN(Sheet1[Date])
)
)

 

The above expression should give you the expected result where duplicates are counted only once for each unique combination of ID and Name, based on the minimum date.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @KyawMyoTun You can use the following DAX expression

 

Ticket =
COUNTROWS(
SUMMARIZE(
FILTER(
Sheet1,
[Date] = CALCULATE(
MIN(Sheet1[Date]),
ALLEXCEPT(Sheet1, Sheet1[ID], Sheet1[Name])
)
),
Sheet1[ID],
Sheet1[Name],
"Min Dt", MIN(Sheet1[Date])
)
)

 

The above expression should give you the expected result where duplicates are counted only once for each unique combination of ID and Name, based on the minimum date.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Dear @rajendraongole1 ,
 This works perfectly. Thanks a lot for your help.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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