Forum Discussion
Create a graph with calculated values between 2 tables per week
- 2 years ago
Hello
Thank you very much for the answer, I had to adjust the graph a little so that it was identical to what I need, there was something that did not fit me but it was a mistake of mine in the table, but the answer is correct
Thank you and greetings!
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Create calculated table references:
Table = UNION('Table1','Table2')
3.Create calculated column references:
Average A1 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="A1"))Average A2 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="A2"))Average B1 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="B1"))Average B2 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="B2"))Average C1 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="C1"))Average C2 = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Week]),'Table'[Component 1]="C2"))Product A = IF('Table'[Average A1]&&'Table'[Average A2],
10-'Table'[Average A1]+'Table'[Average A2],BLANK())
Product B = IF('Table'[Average B1]&&'Table'[Average B2],
11-'Table'[Average B1]+'Table'[Average B2],BLANK())
Product C = IF('Table'[Average C1]&&'Table'[Average C2],
15-'Table'[Average C1]+'Table'[Average C2],BLANK())
4.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello
Thank you very much for the answer, I had to adjust the graph a little so that it was identical to what I need, there was something that did not fit me but it was a mistake of mine in the table, but the answer is correct
Thank you and greetings!