Forum Discussion
Summarise Non Unique Values
hi grega
not sure what column do you want to summarize. Let me suppose you want the general Margin%, then try like:
Margin% =
VAR _table =
SUMMARIZE(
TableName,
TableName[Customer Name],
TableName[Order Number],
TableName[Stock Reference],
TableName[Cost Price],
TableName[Sale Price]
)
RETURN
1 -
DIVIDE(
SUMX(_table, TableName[Cost Price]),
SUMX(_table, TableName[Sale Price])
)
Hi
Thanks for the reply.
I'm trying to summarise all the columns if multiple rows are itentical for an order. So if you have multiple rows where the Cost Price, Sale Price and Margin % are the same, sumarise. If there are orders where the Cost Price, Sale Price and Margin % on an order are different I don't want to summarise. I hope that is clear.
Thanks,
Greg.
If there are
- grega3 years ago
Helper II
Hi,
Sure, I'm probably not explaining this very well. With regard to the identical rows. I don't actually want to sum the values of the identical rows. I only want one row from multiple rows. For example, If I originally have this:
Id Cust Name Order No Stock Reference Cost Price Sales Price Margin %1 AB Smith 2354 KPCB_14768 15 36.37 58.76 2 AB Smith 2354 KPCB_14768 15 36.37 58.76 3 AB Smith 2354 KPCB_14768 15 36.37 58.76 I need this:
Id Cust Name Order No Stock Reference Cost Price Sale Price Margin % 1 AB Smith 2354 KPCB_14768 15 36.37 58.76 Also, anything that is not a duplicate needs to display all the rows for the order, etc.
I hope this clears things up.
Thanks,
Greg.
- grega3 years ago
Helper II
Sorry, the table did not come out very well. Try these
Before:
Id Cust No Order No Stock Ref Cost Price Sales Price Margin % 1 AB Smith 2354 KPCD_14768 15 36.37 58.76 2 AB Smith 2354 KPCD_14768 15 36.37 58.76 3 AB Smith 2354 KPCD_14768 15 36.37 58.76 After:
Id Cust No Order No Stock Ref Cost Price Sale Price Margin % 1 AB Smith 2354 KPCD_14768 15 36.37 58.76 Thanks,
Greg.