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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Custom Column Creation help

Hi,

 

Can any one please help me on below issue. I have an Input table like below.

Input Table:

WONum     Assoc. Work Order number
7609450      7605060
7605060      7167140

 

 

Logic:

L1if WONum is not repeated in Assoc. Work Order Number then its L1 (7609450)
L2check L1 (7609450) against WO and find associat WO Number(7605060)
L3check L2 (7605060) against WO and find associat WO Number(7167140)

 

Output Table:

L1L2L3
760945076050607167140

I have created below custom fields but L3 is not working

L1[A=#"Renamed Columns1"[WONum],
B=#"Renamed Columns1"[Assoc. Work Order Number],
to =
if not List.Contains(B,[WONum]) then [WONum] else null][to]
L2[A=#"Level1"[WONum],
B=#"Level1"[L1],
C=#"Level1"[Assoc. Work Order Number],
to =
if List.Contains(B,[WONum]) then [Assoc. Work Order Number] else null][to]
L3[A=#"Level2"[WONum],
B=#"Level2"[L2],
C=#"Level2"[Assoc. Work Order Number],
to =
if List.Contains(B,[WONum]) then [Assoc. Work Order Number] else null][to]

But getting output like below L3 is coming in seperate row instead of first row.

paw2_0-1679108676303.png

@Ahmedx 

1 ACCEPTED SOLUTION

Hi,

I am a bit confused, but please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_0-1679117449431.png

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file if it suits your requirement.

Jihwan_Kim_1-1679111621910.png

 

Jihwan_Kim_0-1679111600403.png

 

New Table = 
FILTER (
    SELECTCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE ( 'Table', 'Table'[WONum], 'Table'[Assoc. Work Order number] ),
            "@L3",
                MAXX (
                    FILTER (
                        'Table',
                        'Table'[WONum] = EARLIER ( 'Table'[Assoc. Work Order number] )
                    ),
                    'Table'[Assoc. Work Order number]
                )
        ),
        "L1", 'Table'[WONum],
        "L2", 'Table'[Assoc. Work Order number],
        "L3", [@L3]
    ),
    [L3] <> BLANK ()
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim Thanks alot for your help. Please can you help me how to add L4 also in the above example. For example WO = 7167140 is repated in AWO so how to show L4= 7123456

 

It's working fine upto L3 level. But in my requirement untill L3 or L4 is not repeated in WONum need to create hierarchy. 

 

paw2_0-1679113114284.png

 

Hi,

I am a bit confused, but please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_0-1679117449431.png

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim 

Sorry the above one is not working. Please can you see the below Input and expected output. Currently the above two expressions working as individual but need L3 and L4 solution in one expression. In some cases have L3 is max in some cases have L4 is max.

Logic is 

L1 = if WO is not in associate wo
L2 = check L1 against WO and find associat WO 
L3 = check L2 against WO and find assocuate WO
L4= do for L3 again

loop will continue until it doesn't find next value

 

paw2_0-1679123819598.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors