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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jcarlos
Helper I
Helper I

Create a WBS Code using a PATH column

Hi there!

 

I got a parser from Primavera P6.

 

From PROJWBS table I have wbs_id (unique value), parent_wbs_id (tells me the hierarchy), and wbs_short_name (gives me a code name).

 

The hierarchy has 9 levels.

 

To define the hierarchy, I have created a Path column using:

 

Path = PATH (PROJWBS[wbs_id],PROJWBS[parent_wbs_id])

 

Now, I need to create the WBS Full Code, using:

 1. Hierarchy

 2. wbs_short_name

 

For example:

 

jcarlos_0-1638796382802.png

 

Perhaps it's an open question, but I don't know how to start.

 

In this link you can find the .pbix file

 

WBS  

Thanks a lot for your help.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @jcarlos ,

 

Try the following code:

 

short name = 
LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 1 )) &
IF( NOT( ISBLANK(PROJWBS[Level_2])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 2 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_3])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 3 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_4])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 4 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_5])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 5 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_6])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 6 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_7])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 7 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_8])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 8 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_9])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 9 ))) 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @jcarlos ,

 

Try the following code:

 

short name = 
LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 1 )) &
IF( NOT( ISBLANK(PROJWBS[Level_2])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 2 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_3])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 3 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_4])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 4 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_5])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 5 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_6])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 6 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_7])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 7 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_8])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 8 ))) &
IF( NOT( ISBLANK(PROJWBS[Level_9])),"." &LOOKUPVALUE(PROJWBS[wbs_short_name],[wbs_id],PATHITEM ( PROJWBS[Path], 9 ))) 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Many thanks @MFelix .

 

A simple and elegant solution.

 

Obrigado...

Hi @jcarlos 

 

Thank you for your words, however sorry but you should select my answer and not yours  😄 so it can help others


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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