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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.