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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Earliest StartDate - Latest EndDate

Dear community members, 

 

Any help is welcome, because I have no idea how to make the correct formula. I have the following question:

 

I have a table with StartDate, EndDate and Clientnumber and each row is a 'invoicing period'. Link to PBIX is here https://we.tl/t-kOuWC5mTqm  

 

Now I want to know the overall invoicing period per Clientnumber, so earliest StartdDate and latest EndDate. 

 

But how should I visualise this in a measure... Is it also possible to use this measure in a new calculated column? (I want to make a new table where each row contains an unique clientnumber, total costs etc...)  

 

Hope to hear soon from you...

 

Best regards, Sander

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous Well, you could put the customer in a table visual and use measures like:

MaxDate = MAX('Table'[EndDate])

MinDate = MIN('Table'[StartDate])

 

You could do similar things in a column but would want to do something like:

MaxDate = MAXX(FILTER('Table',[Client]=EARLIER('Table'[Client]),[EndDate])

 

If you want a new table, you would use similar formulas in a SUMMARIZE or GROUPBY statement.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous Well, you could put the customer in a table visual and use measures like:

MaxDate = MAX('Table'[EndDate])

MinDate = MIN('Table'[StartDate])

 

You could do similar things in a column but would want to do something like:

MaxDate = MAXX(FILTER('Table',[Client]=EARLIER('Table'[Client]),[EndDate])

 

If you want a new table, you would use similar formulas in a SUMMARIZE or GROUPBY statement.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks for your support! The first part of your solution was just the little push I needed! Cheers, Sander

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.