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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculated Column from same table rows

Hi,

 

I am trying to create a new column Calculated Column [New Epic Name] which will have the EPIC Name.

 

For the Type = Epic, the Epic Name is in 3rd Column "Epic Name"

For the Type = Task, the Epic Name is in 4th Column "Epic Link"

But for Sub-Task the Epic Name will be the Parent Key "Ticket" [Epic Link]

 

I am trying this way, but not doing a good job, I know there should be a easy way.

 

New Epic Name =

IF (

 Worklogs[Epic Link] = BLANK (),

 CALCULATE ( Worklogs[Epic Link] , ALLEXCEPT ( Worklogs, Worklogs[Parent Key] ) ),

 Worklogs[Epic Link]

 )

 

 

 

Ticket TypeEpic NameEpic LinkParent KeyCalculated Column [New Epic Name]
DMO-192EpicProject Yellow Tree   
DMO-195Task Project Yellow Tree  
DMO-195Task Project Yellow Tree  
DMO-204Sub-task  DMO-195 
DMO-204Sub-task  DMO-195 
DMO-207Sub-task  DMO-195 
DMO-208Sub-task  DMO-195 
DMO-209EpicGrappling Hook Head   
DMO-210Task Grappling Hook Head  
DMO-211Task Grappling Hook Head  
DMO-212Sub-task  DMO-210 
DMO-229Sub-task  DMO-211 
DMO-255Sub-task  DMO-210 
DMO-256Sub-task  DMO-211 

 

Thanks,

Joydeep

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Anonymous Please try this by adding as "New Column"

 

NewEpicName = 
VAR _lkp = LOOKUPVALUE(EpicsTest[Epic Link],EpicsTest[Ticket],EpicsTest[Parent Key])
VAR _epic = IF(EpicsTest[Type]="Epic",EpicsTest[Epic Name],
                                    IF(EpicsTest[Type] = "Task",EpicsTest[Epic Link],
                                                                _lkp))
RETURN _epic  

image.png





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

Proud to be a PBI Community Champion




View solution in original post

6 REPLIES 6
PattemManohar
Community Champion
Community Champion

@Anonymous Please try this by adding as "New Column"

 

NewEpicName = 
VAR _lkp = LOOKUPVALUE(EpicsTest[Epic Link],EpicsTest[Ticket],EpicsTest[Parent Key])
VAR _epic = IF(EpicsTest[Type]="Epic",EpicsTest[Epic Name],
                                    IF(EpicsTest[Type] = "Task",EpicsTest[Epic Link],
                                                                _lkp))
RETURN _epic  

image.png





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

@PattemManohar I am getting error, it says Cannot find table 'EpicsTest'.

 

error.jpg

 

@Barnee yes the 3rd part is what it tricky, or else could have used RELATED()

@Anonymous EpicsTest is the table I've used, you need to give your table name and corresponding fields accordingly...





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

Thank you @PattemManohar it worked perfectly 

Oh I see, I didn't read through the third part properly. 

Barnee
Advocate IV
Advocate IV

Hey @Anonymous,

 

try this one out:

New Epic Name = IF(
                  AND(Table1[Epic Name]=BLANK(),Table1[Parent Key]=BLANK()),
                  Table1[Epic Link],
                  IF(
                    AND(Table1[Epic Name]=BLANK(),Table1[Epic Link]=BLANK()),
                    Table1[Parent Key],
                    Table1[Epic Name])
                   )

 

Please let me know if it's what you wished to achieve.

 

Regards,

Barna 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.