Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello experts!
I have a table containing the Unit Cost of different Cost Category of different Airlines; and another table with the Cost Driver of different Cost Category of different Airlines. I wish to show Total Cost by airline and by cost category in a single visual.
But, I cannot create two active relationships across two tables, so the visual cannot distinguish each Airline's Cost Driver.
My expected result:
The actaul result:
Source data : Extract of Unit Cost Table:
Source data : Extract of OpStat (Cost Driver) Table
Relationship Table
Here is my measure:
(My measure have another bug related to the Date measure, please ignore it, that will be a seperate question.)
My BI Dashboard and Data File can be retrieved here :
test - Copy
Thanks a lot !
Solved! Go to Solution.
Hi @yoyfreddy ,
Create a new column in Cost table:
Driver = RELATED(Classification[Cost Driver])
Create a new measure like below:
Measure =
var unit_cost = MAX(Cost[Unit Cost])
var airline_ = MAX(Cost[Airline])
var driver_ = MAX(Cost[Driver])
var sum_opstat = CALCULATE(SUM(OpStat[Value]),FILTER(OpStat,OpStat[Airline]=airline_&&OpStat[Cost Driver]=driver_))
return MAX(Cost[Unit Cost])*sum_opstat
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @yoyfreddy ,
Create a new column in Cost table:
Driver = RELATED(Classification[Cost Driver])
Create a new measure like below:
Measure =
var unit_cost = MAX(Cost[Unit Cost])
var airline_ = MAX(Cost[Airline])
var driver_ = MAX(Cost[Driver])
var sum_opstat = CALCULATE(SUM(OpStat[Value]),FILTER(OpStat,OpStat[Airline]=airline_&&OpStat[Cost Driver]=driver_))
return MAX(Cost[Unit Cost])*sum_opstat
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Liang for your help. Your file also solved my Date problem too!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 64 | |
| 45 | |
| 41 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 191 | |
| 127 | |
| 106 | |
| 78 | |
| 53 |