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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jhenderson525
Frequent Visitor

working with multiple dates, please help!

Greeting,

I would like to create two additional columns to the table below:

 

1st column  {Current Phase Date] - would find the value of the [Current phase] of each [Project], then somehow look up the date in the relative phase date columns, and retrun that date.

For example Project A's current phase is 3, so return the date 1/1/2020 in this

 

2nd column [Next Phase Date]- similarly, would find the value of [Next phase] for each project, then return the date from the relative column.

is this possible?

ProjectCurrent phaseNext PhasePhase 1 date Phase 2 datePhase 3 datePhase 4 datePhase 5 datePhase 6 date
A341/1/20161/1/20171/1/20201/1/20241/1/20301/1/2032
B561/1/20195/1/20197/1/20198/1/20191/1/20231/1/2024
CNot started11/1/20242/1/20245/1/20248/1/202410/1/20241/1/2025
D6Complete1/1/20222/1/20223/1/20224/1/20225/1/20228/1/2022
1 ACCEPTED SOLUTION

Hi @jhenderson525 ,

 

If this is not a calculation table and does not contain calculated columns, you may consider doing this in the PowerQuery editor.

vcgaomsft_0-1675128001102.png

Make a copy of the table and name it Table2-->select [Phase 1 date] to [Phase 6 date] and unpivot the columns-->add 2 custom columns:

if Text.Contains([Attribute],[Current phase]) then [Value] else null
if Text.Contains([Attribute],[Next Phase]) then [Value] else null

vcgaomsft_1-1675128139784.png

vcgaomsft_2-1675128155624.png

select [project] and group data:

vcgaomsft_3-1675128266007.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@jhenderson525 , Not very clear , but you need a  new column like

 

next phase date= minx(filter(Table, [Project] = earlier([Project])  && [Current Phase] = earlier([Next Phase]) ), [Phase 1Date])

 

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

 

phasedateissue.JPG

Thank you for responding. I hope this image will help provide some clarity. Basically i need to create two new columns in a new table that will reference the respective dates for the current phase and next phsae of each project. With the caveat that Current Phase for some projects may be blank (since they have not started) and Next Phase may also contain blanks (since they have completed). Thanks again!

Hi @jhenderson525 ,

 

If this is not a calculation table and does not contain calculated columns, you may consider doing this in the PowerQuery editor.

vcgaomsft_0-1675128001102.png

Make a copy of the table and name it Table2-->select [Phase 1 date] to [Phase 6 date] and unpivot the columns-->add 2 custom columns:

if Text.Contains([Attribute],[Current phase]) then [Value] else null
if Text.Contains([Attribute],[Next Phase]) then [Value] else null

vcgaomsft_1-1675128139784.png

vcgaomsft_2-1675128155624.png

select [project] and group data:

vcgaomsft_3-1675128266007.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

@v-cgao-msft @amitchandak Thank you both for taking the time out of your day to respond. I really appreciate the assistance. The pivot table solution is perfect!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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