Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I have two datasets as follows:
Dataset 1
| ID | Erect Hours | Dismantle Hours |
| 1 | 10 | 20 |
| 2 | 5 | 10 |
Dataset 2
| ID | Job Type | % Complete | Burned |
| 1 | Erect | 100% | 12 |
| 2 | Erect | 100% | 5 |
| 2 | Dismantle | 100% | 10 |
| 2 | Day Work Mod | 5 | |
| 2 | Star Rate Mod | 100% | 4.5 |
Relationship has been created between ID in both datasets.
I need to create a DAX measure as follows:
If job type is 'Erect' then (% complete * erect hours)
If job type is 'Dismantle' then (% complete * dismantle hours)
If job type is 'Star Rate Mod' then (% complete * 4.5)
If job type is 'Day Work Mod' then (sum burned)
Is the above logic possible in one DAX statement?
Solved! Go to Solution.
@Anonymous , A new column in dataset2
new column =
var _1 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Erect Hours])
var _2 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Dismantle Hours])
return
Switch([Job Type],
"Erect", [% complete]*_1,
"Dismantle", [% complete]*_2,
"Star Rate Mod", [% complete]*.45,
"Dismantle", [Burned]
)
@Anonymous , A new column in dataset2
new column =
var _1 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Erect Hours])
var _2 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Dismantle Hours])
return
Switch([Job Type],
"Erect", [% complete]*_1,
"Dismantle", [% complete]*_2,
"Star Rate Mod", [% complete]*.45,
"Dismantle", [Burned]
)
Thanks for answering my questions.
Is there anyway I can use the below formular but reference columns from another table in the highlighted section of your code?
new column =
var _1 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Erect Hours])
var _2 = sumx(filter(dataset1, dataset1[ID] = dataset2[ID]) ,[Dismantle Hours])
These highlighted columns come from another table that is connect via a many to many relationship.
Many thanks,
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 30 | |
| 26 | |
| 25 |