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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JonathanK1999
Frequent Visitor

Measure to divide all rows by a 'parent' total row

I want to calculate in the % of ventas column, each sub category divided by the ventas category.

 

For example: divide bebidas row by the total ventas row to show the percentage of how much the bebidas row reprents of total ventas. (if bebidas is 10 and total ventas 100, it should give me 10%)

 

I want to just have a formula that applies for every row, as I know that I can get a total individual formula for each row by dividing by each row individually (see example below). But the example below just gives me what percentage of ventas is represented by bebidas in the example below, not for every row

 
% de ventas en bebidas = (DIVIDE((CALCULATE(SUM(ConsolidadoPG[Valor]), ConsolidadoPG[Sub Categoria]="Bebidas")), CALCULATE(SUM(ConsolidadoPG[Valor]), ConsolidadoPG[Categoria]="Ventas")))

JonathanK1999_1-1678298965748.png

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@JonathanK1999 , Based on what I got, You need measure like

 

divide(SUM(ConsolidadoPG[Valor]), CALCULATE(SUM(ConsolidadoPG[Valor]), removefilters(ConsolidadoPG[Sub Categoria]) ))

 

 

Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak, that would give me the % of each row with regards to the parent row. However, I want % of rows divided by the ventas total row, which is not necessarily the parent row

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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