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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jch
Employee
Employee

Suggestions to get the join between Objectives and Key Results working?

In this Power Bi, I'm trying to write something like the statement below, both tables filtered on the field IsCurrent.

 

Does anyone have any suggestions to write the Dax table statement correctly?

DaxTable = SUMMARIZE(
'Objectives'
, 'Objectives'[IsCurrent]
, 'Objectives'[Work Item ID]
, 'Key Results'[Parent Work Item ID]
, 'Objectives'[Title]
, 'Key Results'[Work Item ID]
, 'Key Results'[IsCurrent]
, 'Key Results'[Title]
, 'Key Results'[Jan Decimal X Weight]
, 'Key Results'[Feb Decimal X Weight]
, 'Key Results'[Mar Decimal X Weight]
)

Ideally, I want to create one Dax table that's similar to the format and filters like what's displayed in this visual

jch_0-1640725330191.png

 

4 REPLIES 4
bcdobbs
Super User
Super User

I think most of the trouble you're having is that you have repeated columns of the same name. Could work around it using SELECTCOLUMNS first. However I renamed 3 columns in the Objectives table to "Objective Work Item ID", "Objective Title" and "Objective IsCurrent". You could match in Key Results for consistency.

 

Then the following DAX will give you what you need including the filters.

JoinTable = 
VAR ObjectivesFilter =
        TREATAS ( { TRUE }, 'Objectives'[Objective IsCurrent] )
VAR KeyResultsFilter =
        TREATAS ( { TRUE }, 'Key Results'[IsCurrent] )
RETURN 
SUMMARIZECOLUMNS (
    'Objectives'[Objective Work Item ID],
    'Key Results'[Parent Work Item ID],
    'Key Results'[Work Item ID],
    'Objectives'[Objective Title],
    'Key Results'[Title],
    'Objectives'[Objective IsCurrent],
    'Key Results'[IsCurrent],
    ObjectivesFilter,
    KeyResultsFilter,
    "SumJan_Decimal_X_Weight", CALCULATE ( SUM ( 'Key Results'[Jan Decimal X Weight] ) ),
    "SumFeb_Decimal_X_Weight", CALCULATE ( SUM ( 'Key Results'[Feb Decimal X Weight] ) ),
    "SumMar_Decimal_X_Weight", CALCULATE ( SUM ( 'Key Results'[Mar Decimal X Weight] ) )
)

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Thank you for your reply. Do I need a relatedtable function in this so that only the rows where 'Objectives'[Work Item Id] = 'Key Results'[Parent Work Item ID]. How do I work around the error in the screenshot below? 

jch_0-1640872568600.png

 

askhanduja
Helper I
Helper I

DaxTable = 
CALCULATETABLE(
SUMMARIZE(
        'Key Results'
        , 'Objectives'[IsCurrent]
        , 'Objectives'[Work Item ID]
        , 'Key Results'[Parent Work Item ID]
        , 'Objectives'[Title]
        , 'Key Results'[Work Item ID]
        , 'Key Results'[IsCurrent]
        , 'Key Results'[Title]
        , 'Key Results'[Jan Decimal X Weight]
        , 'Key Results'[Feb Decimal X Weight]
        , 'Key Results'[Mar Decimal X Weight]
    ),
    Objectives[IsCurrent] = TRUE(),
    'Key Results'[IsCurrent] = TRUE()
)

 

If this answers your question please mark it as the answer so that others with a similar question can find the post easily. A thumbs up to the post would be greatly appreciated as well.

Thank you for your reply. Thank you for your reply. Do I need a relatedtable function in this so that only the rows where 'Objectives'[Work Item Id] = 'Key Results'[Parent Work Item ID]. How do I work around the error in the screenshot below?

 

jch_1-1640872741136.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.