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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

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

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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