Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I need help with Power Bi function.
So I have many order numbers that are sometimes repeated in many rows.
Factor = columnx/columny
I want to calculate column that shows factor for specific order number not for row.
Order number 213 (2+6+15)/(2+2+3) = 3,28
Order number | columnx | columny | Factor |
213 | 2 | 2 | 3,28 |
213 | 6 | 2 | 3,28 |
213 | 15 | 3 | 3,28 |
214 | 20 | 4 | 3,5 |
214 | 8 | 4 | 3,5 |
215 | 4 | 2 | 2 |
216 | 18 | 9 | 2,36 |
216 | 8 | 2 | 2,36 |
I have the biggest problem to make caclucation for specific order number. Any ideas how to calculate it?
Thanks,
Aleks
Solved! Go to Solution.
Hi @ALEKSGOD ,
Please create a new column:
Column =
var sum_columnx = CALCULATE(SUM('Table'[columnx]),FILTER(ALL('Table'),'Table'[Order number] = EARLIER('Table'[Order number])))
var sum_columny = CALCULATE(SUM('Table'[columny]),FILTER(ALL('Table'),'Table'[Order number] = EARLIER('Table'[Order number])))
return
DIVIDE(sum_columnx,sum_columny)
Result:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ALEKSGOD ,
Please create a new column:
Column =
var sum_columnx = CALCULATE(SUM('Table'[columnx]),FILTER(ALL('Table'),'Table'[Order number] = EARLIER('Table'[Order number])))
var sum_columny = CALCULATE(SUM('Table'[columny]),FILTER(ALL('Table'),'Table'[Order number] = EARLIER('Table'[Order number])))
return
DIVIDE(sum_columnx,sum_columny)
Result:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
93 | |
83 | |
77 | |
73 | |
66 |
User | Count |
---|---|
115 | |
104 | |
93 | |
64 | |
61 |