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! Request now

Reply
Anonymous
Not applicable

Date range based on group column

IdDateAmount
105/05/201950
110/05/2019200
115/05/2019200
120/05/2019200
121/05/2019200
205/05/2019100
210/05/2019150
215/05/2019115
220/05/2019150
305/05/2019200
310/05/201975
315/05/201975
420/05/2019150
510/05/2019200
520/05/2019125
605/05/2019100

 

Based on the [date] and [ID] columns is there a way to get a date range per ID:

 

IDDate Range
105/05/2019 - 21/05/2019
205/05/2019 - 20/05/2019
305/05/2019 - 15/05/2019
420/05/2019 - 20/05/2019
510/05/2019 - 20/05/2019
605/05/2019 - 05/05/2019

 

 

I've tried adding a new column but it doesnt respect the ID column:

Column = CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Max Date])) & "-" & CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[Max Date]))
1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @Anonymous 

Add a measure like this to you visual.

 

Date Range_ =
var _ID = SELECTEDVALUE(Sheet1[ID])
var _MinDate = CALCULATE(MIN(Sheet1[Date]), Sheet1[ID] = _ID)
var _MaxDate = CALCULATE(MAX(Sheet1[Date]), Sheet1[ID] = _ID)

Return
CONCATENATE(CONCATENATE(_MinDate, " - "), _MaxDate)
 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

1 REPLY 1
aj1973
Community Champion
Community Champion

Hi @Anonymous 

Add a measure like this to you visual.

 

Date Range_ =
var _ID = SELECTEDVALUE(Sheet1[ID])
var _MinDate = CALCULATE(MIN(Sheet1[Date]), Sheet1[ID] = _ID)
var _MaxDate = CALCULATE(MAX(Sheet1[Date]), Sheet1[ID] = _ID)

Return
CONCATENATE(CONCATENATE(_MinDate, " - "), _MaxDate)
 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

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