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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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