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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
bvsaicharitha
Helper I
Helper I

Filter and sum

Hi

 Table 

Company Sales 

x              200

y              100

x               50

z              150

z               80

 

 

I want to calculate the total sales of a company / sum of all sales.

For example for x- (200+50)/(total sum of sales)  

I am using SUMX( filter( table, table[Company]),table[Sales], [Sales])/ Calculate ( SUM(Tables[Sales], ALL(Table[Sales])

 

I am not able to filter the column: Its showing me an error

can you please help

1 ACCEPTED SOLUTION

Hi @bvsaicharitha,

could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @bvsaicharitha,

Based on my test, you can refer to below steps:

1.I have entered some sample data to test for your problem like the picture below:

1.PNG

2.Create a measure.

Measure = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Company]<=MAX('Table1'[Company])))/CALCULATE(SUM(Table1[Sales]),ALL(Table1))

3.Create a Card visual and a Table visual, add the related fields. Now you can see the result.

2.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/bq5ir6n8r61ii5s/Filter%20and%20sum.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, 

Can you please explain me why you used max function to filter the name of the company which is text?

MAX returns the largest numeric value right?

Hi @bvsaicharitha,

could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @bvsaicharitha,

The max function is an aggregate function, it could be used in the formula to filter the content of a column, not only the numeric value, you could also filter the text, date, time and other contents.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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