Reply
Laurent123
Regular Visitor

Sorting data from 3 tables.

Hello,

I have 3 tables.

 

Table A where I have my work orders.

 

Work order

Work order 1

Work order 2

Work order3

 

Table B with all the parts used during those work orders and the quantity. Table A and B are linked with a one-to-many relationship, so a workorder can have multiple references used.

Work order

Reference

Qty

Work order 1

123

5

Work order1

456

8

Work order 1

789

7

Work order 2

789

9

Work order 2

456

3

Work order 3

789

8

 

Table C with the references and the price for each

 

Reference

Price

123

200

456

300

789

400

 

I would like to choose a work order and see all the used parts with the total price per line and a Grand Total.

 

I’m starting with Power BI but have worked since years with access and Excel.

 

If someone could help that would be wonderful.

 

Thank you so much and have a great 2024 year.

2 ACCEPTED SOLUTIONS

Hi, @Laurent123 

you can download file click HERE 

View solution in original post

 Hi @Laurent123 

I updated my measure formula and it now shows correctly

 

Total Price =

SUMX(

    'Table 2',

    'Table 2'[Qty] * RELATED('Table 3'[Price])

)

 

vjialongymsft_0-1704418617040.png

 

View solution in original post

8 REPLIES 8
v-jialongy-msft
Community Support
Community Support

Hi @Laurent123 

 

Here are the three tables you provided, The relationship between them has been properly established

vjialongymsft_0-1704350586708.png

 

vjialongymsft_1-1704350586711.png

vjialongymsft_2-1704350612455.png

vjialongymsft_3-1704350619243.png

 

 

Based on your three tables, you can build such a table in the Report View interface

vjialongymsft_4-1704350655990.png

 

 

You can create such a measure to calculate  total price per line

 

Total Price = MAX('Table 2'[Qty])*MAX('Table 3'[Price])

 

Then you can put this measure into the table

vjialongymsft_5-1704350666184.png

 

 

Then you can create a slicer and drag the Work order field into the slicer

vjialongymsft_6-1704350678498.png

 

 

This is the result you want, each time you select an option in the slicer, the values in the table will change as well

vjialongymsft_7-1704350693754.png

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Hello,

 

THanks for helping.

 

The Total looks wrong

Laurent123_0-1704362813722.png

 

 Hi @Laurent123 

I updated my measure formula and it now shows correctly

 

Total Price =

SUMX(

    'Table 2',

    'Table 2'[Qty] * RELATED('Table 3'[Price])

)

 

vjialongymsft_0-1704418617040.png

 

Dangar332
Super User
Super User

hi, @Laurent123 

 

Column = CALCULATE(MIN('l 3'[price])*MIN('l 2'[qty]))


make a new column 

Dangar332_0-1704304766119.png

 

Dangar332_1-1704304804303.png

 

 

Hello, thank you.

 

May I ask you how did you create the column "Sum of Column"?

hi, @Laurent123 

 

when you drag your column to table visula or other visual in visualization pane click on drop down sign(show in image below) your column name that open selection box from that you can select (sum,avearge,count....)

 

look below image

Dangar332_0-1704363049842.png

 

Sorry but I don't have all those choices

 

It is in French but ...

Laurent123_0-1704363693286.png

 

Hi, @Laurent123 

you can download file click HERE 

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)