March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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?
Solved! Go to Solution.
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.
Best regards,
Yuliana Gu
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.
Best regards,
Yuliana Gu
How about this?
my_measure =
VAR
_sum = SUM(goal_value)
RETURN
IF((Workers[job_title] = "GP"; _sum + 10; _sum)
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)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |