Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GlynMThomas
Resolver I
Resolver I

Work out percentage of sales per group by date.

Hi Guys,

 

I have some sales data, I need to work out the percentage split per day over different groups so it shows me the percentage split by group for each day. Something like the table below:

 

Sales | Date            | Group | Percent

£300 | 24/01/2019 | Active | 50%

£300 | 24/01/2019 | EFG     | 50%

£200 | 25/01/2019 | Active | 100%

 

As you can see, the first day is split 50/50 between two groups. There would be more groups than this but you get the point.

 

I'm then planning on putting this data in a line graph where the Axis is the Month and year, the legend is the group and the value is the percentage. The plan is to show where what percentages have been invested where over a period of time and allow easy comparison of the groups. At present when I do this it puts the percentages the wrong way. I managed to get this to work in a matrix by selecting percent of column total. I basically want to take that data and stick it in a graph.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @GlynMThomas 

We would just need a couple measures (you will change the table name to match your model).

First one just to sum the Sales

Sales Amount = SUM ( 'Your Table[Sales] )

Then one that calcualtes the % of total across all groups.

Group % of Total = 
VAR TotalAmount = CALCULATE ( [Sales Amount], ALL ( 'YourTable'[Group] ) )
RETURN 
    DIVIDE( [Sales Amount], TotalAmount )

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

Hello @GlynMThomas 

We would just need a couple measures (you will change the table name to match your model).

First one just to sum the Sales

Sales Amount = SUM ( 'Your Table[Sales] )

Then one that calcualtes the % of total across all groups.

Group % of Total = 
VAR TotalAmount = CALCULATE ( [Sales Amount], ALL ( 'YourTable'[Group] ) )
RETURN 
    DIVIDE( [Sales Amount], TotalAmount )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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