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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Many to many related column.

Hello,

 

I have 3 tables, two of them contains data and the another one is a bridge table to avoid many to many relationship error. Like this:

 

Workers                Bridge                  Goals

worker_id   *---1   worker_id  1--- *  worker_id

job_title                                            goal_value

 

 

I need to create a measure on Goals table with the following bussiness logic, if a worker's job title is equal tos "GP" than goal_value is equal to the sum of goal_value plus 10, else goal_value is equal to sum of goal value. 

Translating two dax, I need something like this on Goals table:

 

my_measure = 

    VAR
        job_title = SOME_CODE_OR_FUNCTION(Workers[job_title])

   VAR

        _sum = SUM(goal_value)

    RETURN

        IF(job_title = "GP"; _sum + 10; _sum)

 

But I don't known how to obtain a worker's job title from my Goals table measure. How can I do that?

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Please try this measure:

my_measure =
IF (
    LASTNONBLANK ( Workers[job_title], 1 ) = "GP",
    SUM ( Goals[goal_value] ) + 10,
    SUM ( Goals[goal_value] )
)

Insert a table visual, add 'Bridge'[worker_id], 'Workers'[job_title] and [my_measure] into it.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Please try this measure:

my_measure =
IF (
    LASTNONBLANK ( Workers[job_title], 1 ) = "GP",
    SUM ( Goals[goal_value] ) + 10,
    SUM ( Goals[goal_value] )
)

Insert a table visual, add 'Bridge'[worker_id], 'Workers'[job_title] and [my_measure] into it.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RolandsP
Resolver IV
Resolver IV

How about this?

 

my_measure = 

   VAR

        _sum = SUM(goal_value)

    RETURN

        IF((Workers[job_title] = "GP"; _sum + 10; _sum)

Anonymous
Not applicable

I can not do this, since I am doing this measure on Goals table.

OK, I got. Then try this one

 

my_measure = 

    VAR
        job_title = SELECTEDVALUE(Workers[job_title])

   VAR

        _sum = SUM(goal_value)

    RETURN

        IF(job_title = "GP"; _sum + 10; _sum)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors