Forum Discussion
DennisSchlein
Helper III
3 years agoNewbie - Basic Cost/Sales question
Hi I have worked on structuring my data, to work in my power bi model. But working with it now, im not sure acuatly how to do it. The essense if I have 2 fact tables - Cost and Sales. ta...
- 3 years ago
DennisSchlein , Create a new column in the sales table
new cost =
Var _max = maxx(filter(cost, cost[Order] = sales[Order] && cost[TYpe] = sales[Type]), cost[Amount])
var _max = maxx(filter(cost, cost[parcelNumber] = sales[parcelNumber] && cost[TYpe] = sales[Type]), cost[Amount])
return
coalesce(_max, _max1)
or new column in cost
new cost =
Var _max = maxx(filter(sales, cost[Order] = sales[Order] && cost[TYpe] = sales[Type]), sales[sales Amount])
var _max = maxx(filter(sales, cost[parcelNumber] = sales[parcelNumber] && cost[TYpe] = sales[Type]), sales[sales Amount])
return
coalesce(_max, _max1)
DennisSchlein
Helper III
3 years agoHi amitchandak , ill take a look and get back to you 🙂