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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
manojk_pbi
Helper IV
Helper IV

Need help in writing the logic to build a required table on a give data

Hi Friends,

 

I have below data from AzureDevOps in excel format. I need to create a logic to create a output to have 2 more columns one to add parent ID to all Epics (it's parent is System Epic) and another one it to pick the latest id from the epics and add to system epic line

item. (ID starts with x_wNNNN or xT1_wNNNN or xP_wNNNN)

Below table will have more columns like areapath, iteration path, assigned, status etc. I have removed here to reduce characters

Kindly suggest how this can be achieve ?

 

IDSR IDWork Item TypeTitle 1Tags
535971SR-5391System EpicS.Epic 1 
524467 EpicEpic1130458; sample text; SR-4776; Done
565587 EpicEpic1240096; Delivery3; Diagnostics; Online; x_w2548
569140 EpicEpic1341757; Redundancy; SR-5391; xReady
630563 EpicEpic1459174; Delivery3; Diagnostics; IACTools; Online; x_w2548
559831SR-5779System EpicS.Epic 2 
565637 EpicEpic2140141; Delivery1; ImportedState:Active;  x_w2537; xReady
565640 EpicEpic2240143; Delivery1;  x_w2537
565641 EpicEpic2340144; Delivery1; SR-4358; Deploy; x_w2537
565642 EpicEpic2440145; Delivery3; SE; SR-4358; ; x_w2548
634182 EpicEpic2860137; Delivery3; SignalEngineering; SR-4358; x_w2548
636768 EpicEpic2960249; Delivery5; SR-4358; eee; x_w2609
559839SR-5791System EpicS.Epic 3 
568841SR-5365System EpicS.Epic 4 
547718 EpicEpic4136615; ImportedState:New; Plan; ; ; xReady
591929 EpicEpic4246076; ImportedState:New; Plan; ; xReady
596136 EpicEpic4347299; Connectivity Service; is:New; Plan; ; xReady
607989 EpicEpic44276381; EPIC;  x_w2518
607993 EpicEpic45276385; EPIC; x_w2519
607994 EpicEpic46276390; IOW_EPIC; x_w2522
607995 EpicEpic47276391; W_EPIC; x_w2526

 

Expected output will be : columns higlighted

IDSR IDWork Item TypeTitle 1TagsParent IDLatest Tag
535971SR-5391System EpicS.Epic 1  w2548
524467 EpicEpic1130458; sample text; SR-4776; Done535971 
565587 EpicEpic1240096; Delivery3; Diagnostics; Online; x_w2548535971 
569140 EpicEpic1341757; Redundancy; SR-5391; xReady535971 
630563 EpicEpic1459174; Delivery3; Diagnostics; IACTools; Online; x_w2548535971 
559831SR-5779System EpicS.Epic 2  w2609
565637 EpicEpic2140141; Delivery1; ImportedState:Active;  x_w2537; xReady559831 
565640 EpicEpic2240143; Delivery1;  x_w2537559831 
565641 EpicEpic2340144; Delivery1; SR-4358; Deploy; x_w2537559831 
565642 EpicEpic2440145; Delivery3; SE; SR-4358; ; x_w2548559831 
634182 EpicEpic2860137; Delivery3; SignalEngineering; SR-4358; x_w2548559831 
636768 EpicEpic2960249; Delivery5; SR-4358; eee; x_w2609559831 
559839SR-5791System EpicS.Epic 3  NA
568841SR-5365System EpicS.Epic 4   
547718 EpicEpic4136615; ImportedState:New; Plan; ; ; xReady568841w2526
591929 EpicEpic4246076; ImportedState:New; Plan; ; xReady568841 
596136 EpicEpic4347299; Connectivity Service; is:New; Plan; ; xReady568841 
607989 EpicEpic44276381; EPIC;  x_w2518568841 
607993 EpicEpic45276385; EPIC; x_w2519568841 
607994 EpicEpic46276390; IOW_EPIC; x_w2522568841 
607995 EpicEpic47276391; W_EPIC; x_w2526568841 

 

1 ACCEPTED SOLUTION

Your sample only has one System Epic.  Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

View solution in original post

9 REPLIES 9
v-mdharahman
Community Support
Community Support

Hi @manojk_pbi,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you are looking for a way to transform your data and add new columns. As @lbendlin already responded to your query, please go through his responses and check if it solves your issue.

 

I would also take a moment to thank @lbendlin, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Hi @manojk_pbi,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

Hi @manojk_pbi,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.


Thank you.

Hi @manojk_pbi,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZNLa+MwFIX/ivA6M1ivK2m0KmkW2bQlGZhFCcU4IggcOcTuw/9+JMWO7Y48K18jnY+jc+99fc045UrgbJXtdz84VbHqmtac0eZiy/D3MxQoHKDssPIKwhiI+LvK+kvhg8MVmjMuNWqK86UyqDVfrUaezIQAjR5rZ24I4FymEMQXLM9VuGwq+2GuHfWlLU6ublpbNho9u8o6o9HX2yfhTPY8hVme4NHAw4ILjXbm+O6OhSu76Ci81UN2pjh2kQE050ATDOYLrrBgy562D+vfdV0tueNK0iFiIdRSxGSMGLyVRD4Ex3www6MXX27Pl/ramuO+LVrz66Fs/YFGNw9UzF4ZyKmkCOnJdEYeGKMWJ7S017KZNrSdhmF4NJeq7vS/LJJgsZ7FZ2nvNxPePF2gDMsUSfoCchwCmJLsyRXVxp18m8zVutMEPMeCAJnAqoglTI1YPmEY03cfcjV2Xw3dX14wOum+lOy+ksCXFGxU+P3CCbORQgEw/z4kT+ZTo5eqcCHO+YQorOIjv7PihEAeFvk/rBkJMIUEKc6LIMpHuK6dM2Fgbduhvbl+2NLnZ5tFqDegZMpeSIMIoNKP3uZlux6GF8u7TiXWm/FBxwfdTaZGGUvIoJep3Mfx/OdtIvW7dJfyhFQMUu90LoTscPgL", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"SR ID" = _t, #"Work Item Type" = _t, #"Title 1" = _t, Tags = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Work Item Type"}, {{"rows", each _, type table [ID=nullable text, SR ID=nullable text, Work Item Type=nullable text, Title 1=nullable text, Tags=nullable text]}},GroupKind.Local,(x,y)=>Number.From(x=y)),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Parent ID", each [rows]{0}[ID]),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Latest Tag", each List.Last(Text.Split(Text.Combine([rows][Tags],";"),";"))),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Work Item Type"}),
    #"Expanded rows" = Table.ExpandTableColumn(#"Removed Columns", "rows", {"ID", "SR ID", "Work Item Type", "Title 1", "Tags"}, {"ID", "SR ID", "Work Item Type", "Title 1", "Tags"})
in
    #"Expanded rows"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

 

 

Obligatory shoutout to @ImkeF  Table.Group: Exploring the 5th element in Power BI and Power Query –

Thanks @lbendlin , this is exactly what i am looking. 

 

I have not understood completely the logic how it works, pls guide me with some reference material will go through for better understanding.

 

One clarification, will it work if we have more columns like areapath, iterationpath etc from extract and will the same logic works if we have features tagged under epics.

 

I included the link as reference. That's the best i am aware of.

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Hi @lbendlin ,

 

Thanks for your reply. Please find below sample data with all columns and expected output

IDSR IDWork Item TypeTitle 1Title 2Title 3Assigned ToArea PathIteration PathStateTagsTarget DateParentIDLatestTag
559831SR-5779System EpicTitle1  User1Areapth1IterationPath\1.1Active   w2619
565637 Epic Title1.1 User1Areapth1\test\1.1IterationPath\1.1Resolved40141; Delivery1; ImportedState:Active; ; x_w2537; xReady12/5/2025 5:30559831 
526518 Feature   User1Areapth1\test\1.1IterationPath\1.1Closed23394; ImportedFunction:; ImportedState:Active;  565637 
606007 Feature   User1Areapth1\test\1.1IterationPath\1.1Closed48725; ImportedFunction:; ImportedState:New;  565637 
565640 Epic Title1.2 User1Areapth1\test\1.1IterationPath\1.1Resolved40143; Delivery1; VCEAllocation; x_w253712/5/2025 5:30559831 
527129 Feature   User1Areapth1\test\1.1IterationPath\1.1Closed26315; ImportedFunction:; ImportedState:New; 24 Commit; 24 Commit; 24 Commit; 565640 
565641 Epic Title1.3 User1Areapth1\test\1.1IterationPath\1.1Active40144; Delivery1; SR-4358; VCEDeploy; x_w253712/5/2025 5:30559831 
541657 Feature   User1Areapth1\test\1.1IterationPath\1.1Closed36179; ImportedFunction:; ImportedState:New; 24 Commit; 24 Commit; 565641 
630409 Feature   User1Areapth1\test\1.1IterationPath\1.1Closed56770 565641 
565642 Epic Title1.4 User1Areapth1\test\1.1IterationPath\1.1Active40145; Delivery3; SignalEngineering; SR-4358; VCEDeploy; x_w254812/5/2025 5:30559831 
612716 Epic Errors & Warnings  Areapth1\test\1.1IterationPath\1.1Newx_w2619;298999;Delivery39/30/2025 5:30559831 
612717 Feature   User1Areapth1\test\1.1IterationPath\1.1Resolved299000; SPI_25.2_Committed 612718 
612718 Feature   User1Areapth1\test\1.1IterationPath\1.1New299001; SPI_25.2_Committed 612718 
612727 Epic Audit Events  Areapth1\test\1.1IterationPath\1.1New299017;Testings;x_w2609;Commited;Delivery;XPReady9/30/2025 5:30559831 
612730 Feature    Areapth1\test\1.1IterationPath\1.1New299018 612727 
612731 Feature    Areapth1\test\1.1IterationPath\1.1New299019 612727 
619356 Epic Epic2 User1Areapth1\test\1.1IterationPath\1.1Active57241; Delivery3; VCESettings; x_w254812/5/2025 5:30559831 
647835 Feature   User1Areapth1\test\1.1IterationPath\1.1New62529 619356 

Your sample only has one System Epic.  Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
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.