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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.