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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Agnethe
New Member

Percentage of grand total

Hi

 

I hope you can help me with this problem. I  have a table with four columns:

  1. Customernumber
  2. Customername
  3. Sales
  4. Sales shown as Percentage of Grand total

My table contains 50 customers (50 rows). Now I would like to filter the Customernames by using advanced filter to only select the 10 customers with the higest sales. This is fine, but when I do this, the Sales shown as percentage of Grand Total, is based on the Grand Total of only the 10 customers. I need to show it as a percentage of the Grand Total of the 50 customers.

 

Is this possible?

 

Thanks.

 

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Agnethe

 

Hi, try with this measure:

 

% of Grand Total =
DIVIDE (
    SUM ( Table1[Sales] ),
    CALCULATE ( SUM ( 'Table1'[Sales] ), ALL ( 'Table1'[Customer Name] ) )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

5 REPLIES 5
v-huizhn-msft
Employee
Employee

Hi @Agnethe,

As I test, the solution @Vvelarde posted is right. Please try and check if it works fine. Please mark the right reply as answer if you have resolved your issue, so more people will benefit from here. Please feel free to ask if your problem still stay there.

Best Regards,
Angelia

Anonymous
Not applicable

Hi Angelia

I looked for an answer but did not find it - i do have "Email me when someone replies" but I did not get anything.  Also at the top my email says 0.

could you email me and tell me how to get back to this page please?  I suppose it is 

Microsoft Power BI Community, Forums, Get Help with Power BI, Desktop

I am working from home so not sure if I will ever find this page again 🙂

Sorry

Jo

Vvelarde
Community Champion
Community Champion

@Agnethe

 

Hi, try with this measure:

 

% of Grand Total =
DIVIDE (
    SUM ( Table1[Sales] ),
    CALCULATE ( SUM ( 'Table1'[Sales] ), ALL ( 'Table1'[Customer Name] ) )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

Hi...I have the same problem but also last year:

 

I need the same but using previousYear function...I did this but it doesnt work: 

 

DIVIDE(SUM(Vista_TGT[Cantidad]),CALCULATE(SUM(Vista_TGT[Cantidad])),PREVIOUSYEAR(Vista_TGT[Fecha]),ALL(Vista_TGT[Expr3]))

 

Any idea how to fix it?

Thank you very much, exactly what I was looking for.

Regards,

Agnethe

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.