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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
saanah2019
Helper II
Helper II

Find the min and max date

Hi i have a very basic question that I am stuck on.

I have 2 columns from the same table.
Customer Date

Customer    Date
1                 2/2/2018
2                2/6/2018
3                 2/9/2018

so I just want to create a column or measure which will look at each date and then say if it is the min or max date

Customer       Date           Status
1                    2/2/2018       Min
2                   2/6/2018
3                   2/9/2018         Max

1 ACCEPTED SOLUTION

Hi @saanah2019 

You may create a column like below:

Column =
IF (
    'Table'[Date] = MAX ( 'Table'[Date] ),
    "MAX",
    IF ( 'Table'[Date] = MIN ( 'Table'[Date] ), "MIN", BLANK () )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I ran into this same issue earlier today! I was able to find two solutions which I believe might work for you.  I've included the code and link to the other post below. The first solution is through a calculated column and the second is via a measure. 

 

 

Is Latest Row Filter = 
VAR LatestDate = MAXX(FILTER('Table1','Table1'[Type] = EARLIER('Table1'[Type])),'Table1'[Date])
RETURN IF('Table1'[Date]=LatestDate,1,0)

 

Measure =
VAR LatestDate =
    CALCULATE ( MAX ( 'Table1'[Date] ), ALL ( 'table1' ) )
RETURN
    IF ( MIN ( 'Table1'[Date] ) = LatestDate, 1, 0 )

 

https://community.powerbi.com/t5/Desktop/Show-only-data-from-the-latest-date/m-p/443987#M205215

 

Hope these help. 

@Anonymous 
Hey I am not sure why I am not getting the right answer. What am I doign wrong here?
 
Is Latest Row Filter =
VAR LatestDate = MAXX(FILTER(Billing,Billing[Bill Date] = EARLIER(Billing[Bill Date)),Billing[Bill Date)
RETURN IF(Billing[Bill Date=LatestDate,1,0))))
 
Max =
VAR LatestDate =
CALCULATE ( MAX ( Billing[Bill Date] ), ALL ( Billing ) )
RETURN
IF ( MIN ( Billing[Bill Date] ) = LatestDate, 1, 0 )

Hi @saanah2019 

You may create a column like below:

Column =
IF (
    'Table'[Date] = MAX ( 'Table'[Date] ),
    "MAX",
    IF ( 'Table'[Date] = MIN ( 'Table'[Date] ), "MIN", BLANK () )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors