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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JonathanK1999
Frequent Visitor

Dividing all rows by a calculated value

I have created an income statement, and want to divide every single row by the total sales row in a table that looks something like this: 

 

CategorySum of TotalDESIRED ANSWER
Sales $1,000.00 
Food $240.0024%
Clothing $56.006%
Beverages $60.006%
Tickets $644.0064%
COGS $840.0084%
Food $90.009%
Beverages $10.001%
Paper $40.004%
Labor $100.0010%
Rent $600.0060%
Non operating expense $90.009%
Admin. $50.005%
Water $40.004%
Total $70.007%

 

However, each time I try to divide to get the desired answer, I only get the % of the sales components, not of all other rows. I know that for me to get the % for clothing for instance I have to do individual functions like:

 

% clothing of total sales = (DIVIDE((CALCULATE(SUM(ConsolidadoPG[Sum of Total]), ConsolidadoPG[Codigo Unico Linea PG]="Clothing")), CALCULATE(SUM(ConsolidadoPG[Sum of Total]), ConsolidadoPG[Categoria]="Sales")))

 

But how can I create a formula that drags to all rows, and does not filter. So that in a column in the table that would be a row called % of total sales.

2 REPLIES 2
amitchandak
Super User
Super User

@JonathanK1999 , try like

 

% total sales = DIVIDE(CALCULATE(SUM(ConsolidadoPG[Sum of Total])), CALCULATE(SUM(ConsolidadoPG[Sum of Total]), ConsolidadoPG[Categoria]="Sales"))

 

 

or

 

% total sales = DIVIDE(CALCULATE(SUM(ConsolidadoPG[Sum of Total])), CALCULATE(SUM(ConsolidadoPG[Sum of Total]), Filter( all(ConsolidadoPG) , ConsolidadoPG[Categoria]="Sales")) )

 

or

 

% total sales = DIVIDE(CALCULATE(SUM(ConsolidadoPG[Sum of Total])), CALCULATE(SUM(ConsolidadoPG[Sum of Total]), Filter( allselected(ConsolidadoPG) , ConsolidadoPG[Categoria]="Sales")) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Did not work, I am not getting the desired answer, and its just filtering for the values that fall under the sales sub category, such as food, clothing, beverages and tickets in the example above.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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