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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jch
Microsoft Employee
Microsoft 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!!
jch
Microsoft Employee
Microsoft Employee

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.

jch
Microsoft Employee
Microsoft Employee

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.