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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ModelFear
Frequent Visitor

What would be the DAX formula

Hi all,
Below is my model. Red lines indicate the relationships.
I need a formula for calculated column called margin that takes:
price each baht to minus actual cost, then divide by price each baht again.
Modelagaing.jpg

Sample of table -Sale

Sale.jpg

 

Sample of table - ProductionCost
Note various actual costs for various dates - so average is needed for each item.
My aim is to later have bar charts of margins by customers, item numbers, for years 2022, 2023 etc.

ProductionCost.jpg

 

 

I just need this bit to close another thread that has become too long. Thank you so much!

 

Lin

 

2 REPLIES 2
lbendlin
Super User
Super User

What's the rationale for the bidirectional link?

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

The model shown- please ignore the bidirectional link, it is incorrect. No bidirection.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.