Reply
joshua1990
Post Prodigy
Post Prodigy
Partially syndicated - Outbound

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:

YearMonthDepartmentProductSales
202301AA15
202302AA260
202310BB140

 

Now I would like to get the percentage of the sales for each product for each YearMonthDepartment combination / group.

How would you do that?

1 ACCEPTED SOLUTION

Syndicated - Outbound

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

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

Syndicated - Outbound

@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]
        )
    )

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Syndicated - Outbound

@Fowmy : Thanks, but I have posted this question within the PQ area to get it resolved using PQ.

Any further ideas?

Syndicated - Outbound

@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%







Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Syndicated - Outbound

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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)