- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Percentage per Group
Hi experts!
I have a table with the year, month and department information.
In addition to that I have sales per product:
Year | Month | Department | Product | Sales |
2023 | 01 | A | A1 | 5 |
2023 | 02 | A | A2 | 60 |
2023 | 10 | B | B1 | 40 |
Now I would like to get the percentage of the sales for each product for each YearMonthDepartment combination / group.
How would you do that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

NewStep=Table.Combine(Table.Group(PreviousStepName,{"Year","Month","Department"},{"n",each let a=List.Sum([Sales]) in Table.AddColumn(_,"Percentage",each [Sales]/a)})[n])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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]
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Fowmy : Thanks, but I have posted this question within the PQ area to get it resolved using PQ.
Any further ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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 like
Year | Month | Department | Sales% |
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

NewStep=Table.Combine(Table.Group(PreviousStepName,{"Year","Month","Department"},{"n",each let a=List.Sum([Sales]) in Table.AddColumn(_,"Percentage",each [Sales]/a)})[n])

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
01-23-2025 07:42 AM | |||
01-31-2023 06:38 AM | |||
04-29-2016 06:14 AM | |||
02-24-2025 12:28 PM | |||
01-30-2024 06:35 AM |