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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
sara_alonso
Helper I
Helper I

number of products by type

Hello,

 

I am not able to solve a problem from other questions, which I know shouldn't be complicated. I have simplified my example in the following table. 

 

In the table, each row represents a customer consumption in a store. Customer 1 buys 1 shirt customer 5, 3 jeans. 

CustomerProductUnitsTotal units per kind of product% of number of products by garment, of the total number
1Shirt1650%
2Shirt3650%
3Shirt2650%
4Jeans1433%
5Jeans3433%
6Belt2217%
 Total units12  

 

My final outcome would be to figure out the last 2 columns in red and especially the last one (which I have now filled up in excel): % of the number of  products grouped by type of garment, relative to the total number of products. More simply, I would like to now how much shirts represent from the total sales. 

 

For that, I have been trying to count the total number of shirts, jeans, or belts, separately, to compare it to the total number of products sold, but the formulas I am trying are not working. 

 

Could someone please help me out? 

 

Many thanks!!

 

 

 

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @sara_alonso ,

 

You need to create 2 measures:

 

1) 

Measure = CALCULATE(SUM('Tabela (2)'[Units]); ALLEXCEPT('Tabela (2)';'Tabela (2)'[Product]))
 
2)
% Total = DIVIDE([Measure]; CALCULATE(SUM('Tabela (2)'[Units]); ALL('Tabela (2)')); 0)
 
I hope it helps you,
 
Ricardo

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
camargos88
Community Champion
Community Champion

Hi @sara_alonso ,

 

You need to create 2 measures:

 

1) 

Measure = CALCULATE(SUM('Tabela (2)'[Units]); ALLEXCEPT('Tabela (2)';'Tabela (2)'[Product]))
 
2)
% Total = DIVIDE([Measure]; CALCULATE(SUM('Tabela (2)'[Units]); ALL('Tabela (2)')); 0)
 
I hope it helps you,
 
Ricardo

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



That worked perfectly, thanks so much @camargos88 !!

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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