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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
syedjunaid11
New Member

Divide by total sum without getting divided into category

Hello,
I have below table. I created average days and total sales measures.

CategoryDaysSales
AB352345
AF89265
AG2450
AF802376
AG344596

 

Now I want to divide each category by the total like sales total is 9632 so I want to divide each category sales like category AF has total sales of 169 divided by 9632. Same goes with other as well. Similarly I want to divide average days with average days measure total of 52.4 for each category.Kindly help. I am new to it.
Thank you

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi  @syedjunaid11  , if I have understood you correctly, you have to create this 2 measures: 

 

Avg_days-Avg_total = var avg_total= CALCULATE(AVERAGE('Table'[Days]),ALL('Table'))
return
divide(CALCULATE(AVERAGE('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
avg_total,"-")

 

Sum_days-Total_sales = var sales_total= CALCULATE(sum('Table'[Sales]),ALL('Table'))
return
divide(CALCULATE(sum('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
sales_total,"-")

 

The result

Bifinity_75_0-1671057575613.png

 

Best Regards

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

If Days and Sales are measures, then how can Category entries repeat in your visual?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Bifinity_75
Solution Sage
Solution Sage

Hi  @syedjunaid11  , if I have understood you correctly, you have to create this 2 measures: 

 

Avg_days-Avg_total = var avg_total= CALCULATE(AVERAGE('Table'[Days]),ALL('Table'))
return
divide(CALCULATE(AVERAGE('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
avg_total,"-")

 

Sum_days-Total_sales = var sales_total= CALCULATE(sum('Table'[Sales]),ALL('Table'))
return
divide(CALCULATE(sum('Table'[Days]),ALLEXCEPT('Table','Table'[Categoy])),
sales_total,"-")

 

The result

Bifinity_75_0-1671057575613.png

 

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.