cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Start/End Date (min/max)

Hello @all,

 

could anyone help me out with the DAX formula on this:

I'm looking for the start and end date of each task in historic data.

 

Thanks in advance!

12-04-_2019_11-12-53.jpg

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

Try this, where Table1 is the table you show:

1. In the query editor, replace "open" for null in TaskEndDate and then convert TaskStartDate and TaskEndDate to type Date

2. Place Table1[Task] in the rows of a matrix visual

3. Create this two measures and place them in values of the matrix

MeasStartDate = MIN(Table1[TaskStartDate])

 

MeasEndDate =
VAR _Res =
    MAX ( Table1[TaskEndDate] )
RETURN
    IF ( NOT ISBLANK ( _Res ), _Res, "open" )

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).      

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous 

Try this, where Table1 is the table you show:

1. In the query editor, replace "open" for null in TaskEndDate and then convert TaskStartDate and TaskEndDate to type Date

2. Place Table1[Task] in the rows of a matrix visual

3. Create this two measures and place them in values of the matrix

MeasStartDate = MIN(Table1[TaskStartDate])

 

MeasEndDate =
VAR _Res =
    MAX ( Table1[TaskEndDate] )
RETURN
    IF ( NOT ISBLANK ( _Res ), _Res, "open" )

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).      

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors