Forum Discussion
Percentage per Group
- 2 years ago
NewStep=Table.Combine(Table.Group(PreviousStepName,{"Year","Month","Department"},{"n",each let a=List.Sum([Sales]) in Table.AddColumn(_,"Percentage",each [Sales]/a)})[n])
joshua1990
Add these columns in a matrix Row section and the following measure in the value.
ROW Section:
'YourTable'[Year],
'YourTable'[Month],
'YourTable'[Department],
'YourTable'[Product]
Sales Percentage =
DIVIDE (
SUM ( 'YourTable'[Sales] ),
CALCULATE (
SUM ( 'YourTable'[Sales] ),
ALLEXCEPT (
'YourTable',
'YourTable'[Year],
'YourTable'[Month],
'YourTable'[Department],
'YourTable'[Product]
)
)
Fowmy : Thanks, but I have posted this question within the PQ area to get it resolved using PQ.
Any further ideas?
- wdx223_Daniel2 years agoCommunity Champion
NewStep=Table.Combine(Table.Group(PreviousStepName,{"Year","Month","Department"},{"n",each let a=List.Sum([Sales]) in Table.AddColumn(_,"Percentage",each [Sales]/a)})[n])
- Fowmy2 years agoSuper User
joshua1990
Sorry about that. Please clarify you need the Percentage of sales by
Year, Month and Department ?
In this case, product will not have a break down. so your matrix should look likeYear Month Department Sales%