Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
| Sl no | Item | Code | Sl no | Parent Item | Child Item | Sl no | Program | Sub Program | Project | ||
| 1 | A | Program | 1 | A | B | 1 | A | B | D | ||
| 2 | B | Sub program | 2 | B | D | 2 | C | Null | E | ||
| 3 | C | Program | 3 | A | D | Result | Table | ||||
| 4 | D | Project | 4 | C | E | ||||||
| 5 | E | Project | Table | 2 | |||||||
| Table | 1 |
Hi @amay15
It seems you may use 'pivot columns' and 'merge queries' in Query Editor to achieve that.
Regards,
Cherie
@amay15 I've tried to solve this in DAX as below:
Please add below two columns (supporting columns) in Table 2 as below
Exclude = VAR _Flag1 = LOOKUPVALUE(Test136ParentChild[Parent],Test136ParentChild[Parent],Test136ParentChild[Child]) VAR _Flag2 = LOOKUPVALUE(Test136ParentChild[Child],Test136ParentChild[Child],Test136ParentChild[Parent]) RETURN IF(Test136ParentChild[Parent]=_Flag1 || Test136ParentChild[Parent]=_Flag2,"Y","N")
Child1 = LOOKUPVALUE(Test136ParentChild[Parent],Test136ParentChild[Parent],Test136ParentChild[Child])
Then, Please try this as a "New Table"
Test136Out =
VAR _Temp = ADDCOLUMNS(
CALCULATETABLE(Test136ParentChild,Test136ParentChild[Exclude]<>"Y")
,"Program",Test136ParentChild[Parent]
,"SubProgram",IF(Test136ParentChild[Child]=Test136ParentChild[Child1],Test136ParentChild[Child])
,"Project",IF(Test136ParentChild[Child1]=BLANK(),Test136ParentChild[Child])
)
RETURN SELECTCOLUMNS(_Temp,"Program",[Program],"SubProgram",[SubProgram],"Project",[Project])
Proud to be a PBI Community Champion
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 23 | |
| 22 | |
| 14 |
| User | Count |
|---|---|
| 48 | |
| 33 | |
| 20 | |
| 18 | |
| 16 |