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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MartinC
Helper I
Helper I

Getting a date value from a text column

Hi All,

 

I am using data from Primavera P6, copied into Excel, and then used in Power BI.  My portfolio of projects is approximately 300 different projects.  Each one has 10 of the same milestones.  I have added a new column that identifies each of the milestones, now I need to have the dates for each one.

Each activity is it's own row.  In the row, I have the activity ID, Start, Finish, and the identifier for the milestone.  What I want is when "Milestone X = 1" for Power BI to return the date from the "Finish" column.

To identify the milestone type I have: 

MartinC_0-1721311001263.png

To get the date I have tried: 

MartinC_1-1721311154709.png

Any help will be appreciated! Thanks 🙂

4 REPLIES 4
ajohnso2
Super User
Super User

Are your dates stored as dates in power query?

If not add or replace your current date column as Date.FromText(<date column>, "dd/mm/yyyy")

 

Your Dax measure perhaps wont work if you are mixing string with dates.

 

Try

if('Activities'[Activity Name] = "Project Brief Accepted", 'Activities'[Finish Date], BLANK())

Thanks for the suggestion, I did try that and just get #ERROR

Greg_Deckler
Community Champion
Community Champion

@MartinC Can you provide sample data? Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

The data is commercially sensitive so I can't share too much sadly 😞

Let's say I have 3 activities (rows) which have columns for "Activity ID", "Activity Name", "Start", "Finish", "Milestone 1", "Milestone 2" and "Milestone 3".

 

Each row will only have a value in either "Milestone 1" 2 or 3.  The result I need in a new column is the finish date from "Finish" when either Milestone 1, 2 or 3 have a value.

 

MartinC_3-1721325059836.png

 

MartinC_2-1721324976214.png

 

I hope that helps?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.