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
Context
I have two tables. I use table 2 to divide the value by the quantity.
Table 1 Column Names
| Ref | Code | Food | ? | Class | Category Header | Category | Value | Year | Source |
| Test | k00022 | Chocolate | 0 | Sweet | Sales | Quarter 1 | 1,000.00 | 2016-17 | XX |
Table 2 Column Names
Code is unique.
| Code | Quantity |
| k00022 | 100 |
Measure
In PowerBI I create a measure to divide Value / Quantity.
Graph
X axis = Year
I want to have the graph have two lines. One line for a particular food type e.g. chocolate and the cost per year.
I also want to have another line which is the averge of the value/quantity per class. So for blueberry which has a class of fruit, I want to have the average of fruit as a second line.
Hi @Dashmir ,
Is your issue solved now?If not,could you pls share some sample data with expected output for test?
Remember to remove the confidential information.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @Dashmir ,
Create a column as below:
quantity = LOOKUPVALUE('Table (2)'[Quantity],'Table (2)'[Code],'Table'[Code],0)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
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 |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |