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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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