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
Anonymous
Not applicable

Creating custom column for each X return non-null value

Hi all,

 

 

I am looking at project management data from Microsoft Project Online (MSPO). I have 2 tables:

1) The project table: contains macro information for each project

2) The task table: contains information about the tasks that are contained in each project.  It looks as follow:

ProjectParent taskTaskDateLaunch date
Project 1GreenlightTask 1Dec 3 2018 
Project 1GreenlightTask 2Dec 10 2018 
Project 1ExecuteTask 1Jan 5 2018 
Project 1ExecuteExecute completeJan 10 2018Jan 10 2018
Project 1LaunchTask 1Jan 11 2018 
Project 1LaunchTask 2Feb 20 2018 

I have created the variable Task.Launch Date such as: 

Launch_Date = IF(AND(Tasks[ParentTaskName]="Execute",Tasks[TaskIsMilestone]=True),Tasks[TaskFinishDate],BLANK())
 

Key question: How do I create a LaunchDate variable on the project table which has the Task.Launch Date value when it is not null?

I have tried a LOOKUP (LOOKUPVALUE(Tasks[Launch_Date],Tasks[ProjectId],Projects[ProjectId])) and telling PowerBI to ignore blank values ALLNOBLANKROW(Tasks[Launch_Date]) but neither is working. I get the error "A table of multiple values was supplied where a single value was expected."

 

Any help would be greatly appreciated!

 
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

HI, @Anonymous

Projects table have a one-to-many relationship with tasks table, so in your calculation, it should returns multiple values

for each row although you had excluded null value, but if there are two or more Launch date,

which Launch date should be returned for the current row?

 

So you could use this formula to create a calculate column:

Column = CALCULATE(MAX(Tasks[Launch_Date]),FILTER(Tasks,Tasks[ProjectId]=Projects[ProjectId]))

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

HI, @Anonymous

Projects table have a one-to-many relationship with tasks table, so in your calculation, it should returns multiple values

for each row although you had excluded null value, but if there are two or more Launch date,

which Launch date should be returned for the current row?

 

So you could use this formula to create a calculate column:

Column = CALCULATE(MAX(Tasks[Launch_Date]),FILTER(Tasks,Tasks[ProjectId]=Projects[ProjectId]))

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

That worked perfectly, thank you for your help @v-lili6-msft!

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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