Reply
KellyLo
Frequent Visitor
Partially syndicated - Outbound

Getting MIN Date based on two fiters

Hello - Hoping for some assistance. I have a column named "Source" and there are two values in this column. The table has two date columns, a date for one source and a date for the other. I need a calculation that will bring the MIN date for each. Example:

ID#1, Source = Email, Email Date = 5/1/2024, 5/2/2024, 5/3/2024.

ID#2, Source = Phone, Phone Date = 5/2/2024, 5/3/2024, 5/4/2024.

ID #3, Source = Phone, Phone Date = 4/1/2024, 5/1/2024, 5/5/2024

I need a calculation that would return this:

ID#1 = 5/1/2024

ID#2 = 5/2/2024

ID#3 = 4/1/2024

 

Is this possible?

 

 

2 ACCEPTED SOLUTIONS

Syndicated - Outbound

Okay so I created this fact table.

 

fact.PNG

 

Based on this fact table, I created this measure:

 

Min_Date =
VAR mindate_col1 = MIN([CreatedDate])
VAR mindate_col2 = MIN([HasAttachmentDate])
return
IF(mindate_col1 <= mindate_col2, mindate_col1, mindate_col2)
 
And was able to produce this visual:
 
result.PNG


View solution in original post

KellyLo
Frequent Visitor

Syndicated - Outbound

Perfect! This group is so amazing. I have a meeting this afternoon and was a little concerned this wouldn't get solved in time. THANK YOU SO MUCH!!!

 

View solution in original post

4 REPLIES 4
KellyLo
Frequent Visitor

Syndicated - Outbound

Of course - Example.JPG

Syndicated - Outbound

Okay so I created this fact table.

 

fact.PNG

 

Based on this fact table, I created this measure:

 

Min_Date =
VAR mindate_col1 = MIN([CreatedDate])
VAR mindate_col2 = MIN([HasAttachmentDate])
return
IF(mindate_col1 <= mindate_col2, mindate_col1, mindate_col2)
 
And was able to produce this visual:
 
result.PNG


KellyLo
Frequent Visitor

Syndicated - Outbound

Perfect! This group is so amazing. I have a meeting this afternoon and was a little concerned this wouldn't get solved in time. THANK YOU SO MUCH!!!

 

kpost
Super User
Super User

Syndicated - Outbound

Could you include a screenshot of a table containing this example data?  It's a bit unclear exactly what values are in what columns and how they are formatted, from what you provided.

 

avatar user

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)