Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I am quite new to power bi in generall and DAX specifically. By now I can solve simple issues myself, but I struggle with the following one I really hope you can help me with:
Data-Modell: There are two tabels.
Tabel 1: OrderPosition
Tabel2: Name: Assigned
Relationships
What I tried so far to get the percentage of assigned products:
Costs (stock order) :=
SUMX (
RELATEDTABLE ( Assigned );
Assigned [AmountAssigned]
)
/ CALCULATE (
SUM ( OrderPosition[Amount] );
USERELATIONSHIP ( OrderPosition[OrderPositionID]; Assigned[OrderPositionStockID] )
)
I hope you can understand what I am trying to explain. This is quite hard for me to describe (especially in english). Thanks a lot!
Solved! Go to Solution.
Hi @capitan_maximum,
I made a sample as your description and create some measures.
costs customer1 = CALCULATE(SUM(OrderPosition[Costs]))
Costs multiply = [Costs (stock order)]*CALCULATE(SUM(OrderPosition[Costs]),FILTER(ALL(OrderPosition),OrderPosition[OrderType] = "stock"))
Gross Profit = SUM(OrderPosition[Revenue])-[Costs multiply]-[costs customer1]
Costs (stock order) =
SUMX (
RELATEDTABLE ( Assigned ),
Assigned [AmountAssigned]
)
/ CALCULATE (
SUM ( OrderPosition[Amount]),
USERELATIONSHIP ( OrderPosition[OrderPositionID], Assigned[OrderPositionStockID] )
)Then we can get the result as below.
For more details, please check the pbix as attached. If that doesn’t meet your requirement, kindly share your sample data and the excepted result to me.
https://www.dropbox.com/s/htmojepzj7nqs8j/USERELATIONSHIP%20issue2.pbix?dl=0
Regards,
Frank
Hi @capitan_maximum,
I made a sample as your description and create some measures.
costs customer1 = CALCULATE(SUM(OrderPosition[Costs]))
Costs multiply = [Costs (stock order)]*CALCULATE(SUM(OrderPosition[Costs]),FILTER(ALL(OrderPosition),OrderPosition[OrderType] = "stock"))
Gross Profit = SUM(OrderPosition[Revenue])-[Costs multiply]-[costs customer1]
Costs (stock order) =
SUMX (
RELATEDTABLE ( Assigned ),
Assigned [AmountAssigned]
)
/ CALCULATE (
SUM ( OrderPosition[Amount]),
USERELATIONSHIP ( OrderPosition[OrderPositionID], Assigned[OrderPositionStockID] )
)Then we can get the result as below.
For more details, please check the pbix as attached. If that doesn’t meet your requirement, kindly share your sample data and the excepted result to me.
https://www.dropbox.com/s/htmojepzj7nqs8j/USERELATIONSHIP%20issue2.pbix?dl=0
Regards,
Frank
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 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |