Hi,
I have two tables with id's that can be linked.
On table 1, I have one unqiue ID per row. On table 2 I have a varying amount of rows per ID:
Table 1 Table 2
ID ID Profit/Loss
188 188 £2.56
189 188 £123.54
In table two, each row has a column providing £ value which I need to sum to give a total per ID in table 1. I am trying to use a calculated column in table 1 to do this but can't get a DAX formula to work - bound to me being new to Power BI and DAX formula.
Can anyone provide some help here?
asumming you have a relationship active betwwen both tables
the calculated column in Table 1 will be:
Profit/Loss = CALCULATE(SUM(Table2[PROFIT/LOSS]))
Thanks for the help, I'll try that now.
By relationship I take it you mean I have a many to one relationship set up with the many on the table 2 side.
In this scenario, either calculated column or measure can work.
You can understand it like calculated column is resolving the calculation on row level, and the measure will aggregate the data on slicing level. For more details, please see: Calculated Columns and Measures in DAX
Regards,
The scenario you have described does not warrant a calculated column, you should be using a measure.
measure_name = sum('table'[column])
given what you have described you should be able to use your value column directly in visuals, if it is a number it is a intrinsic measure which would be displayed with a sigma on the left in the field well
Proud to be a Super User!
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
125 | |
75 | |
65 | |
56 | |
55 |
User | Count |
---|---|
199 | |
104 | |
88 | |
79 | |
77 |