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
NFI27
Helper I
Helper I

Count Items

Hello,

 

This is question is something that i have done similar in excel the problem is i dont know if it could be done in bi. But better.

 

I want to create like an index catalogue to know how many items i manage per product line but it goes a bit deeper.

 

Example  Table:

 

Item Product LineCategorysubcategory Division
adsportwater sportdivingsnorkle
afsportwater sportsurfingwax
agsportwater sportsurfingsurfboard
ahsportland sportfootballball
ajsportland sportbasketballjersey
akschool & officeschoolpaintacrylic
alschool & officeofficeadhesivesglue 
zxschool & officeschoolpaintoil
zcschool & officeschoolwriting instrumentpencil
zvschool & officeofficeadhesivesscotch tape

 

 

This is the table. Now using a slicer i want to be able to count :

 

SLICER: 

Product Line
Sport
school&Office

 

(FOR EXAMPLE IF I CLICK ON SPORTS IT SHOULD SHOW ME)

CatergoryCount item
water sport3
land sport2

 

( IF I CLICK ON WATER SPORTS ITEMS IT SHOULD SHOW ME)

 

Subvategory Count item
Diving1
Surfing2

 

( IF I CLICK ON THE SURFING ITEMS IT SHOULD SHOW ME)

 

DivisionCount Item
Wax1
Surfboard1

 

and this would be the end.

 

Sorry, if this an impossible task just wondering if it could be done.

 

 

Thanks in advance

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

I suggest that you create a Matrix visual and drag the last four fields to the row labels.  Write this measure

 

=COUNTA(Data[Item])


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

Hello,

 

It works partly.

 

as in it counts the items but does not get past the prouct line, so the table ends up being like this:

Product Linecount
Sport 5
School & office5

 

Cant filter through it

Hi,

 

There are filter controls at the bottom right hand side of the visual - see image below

 

Untitled.png


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

It worked. Thanks. Now a continuation to this question.

 

I have added sales and years. i want to separate each year to know how many items were sold each year.

 

Right now i have this:

 

                        
  2016 Measure2016 Sales2017 Measure2017 Sales2018 Measure2018 SalesTOTAL MeasureTOTAL Sales
Sport 48 items1260048 items3700048 items3500048 items84600
 water sport385600382400038200003849600
 diving 13260013150001310001327600
 snorkle13 (items260013 (items1500013 (items1000013 (items27600
 Surfing25300025900025100002522000
 wax10(items100010(items400010(items800010(items13000
 surfboard15 (items200015 (items500015 (items200015 (items9000
 Land Sport307000301300030150003035000
 football2040002080002070002019000
 ball20(items400020(items800020(items700020(items19000
 basketball1030001050001080001016000
 jersey10(items300010(items500010(items800010(items16000

 

But i want to get this:

 

      
  2016 Measure2016 Sales 2017 Measure2017 Sales2018 Measure2018 SalesTOTAL MeasureTOTAL Sales
Sport 26 items1260059 items3700052 items3500068 items84600
 water sport185600322400030200003849600
 diving 7260010150001210001327600
 snorkle7 (items260010 (items1500012 (items1000013 (items27600
 Surfing11300022900018100002522000
 wax6(items100010(items40009(items800010(items13000
 surfboard5(items200012 (items50009(items200015 (items9000
 Land Sport87000271300022150003035000
 football540001580001870002019000
 ball5(items400015(items800018(items700020(items19000
 basketball33000105000680001016000
 jersey3(items300010(items50006(items800010(items16000

 

This way i am segregating each year and i know what items i sold wich year and at the end, i get the total sale with the total amount of items. and after i am done with this i want to add how much percentage does each category, sub-category, division. represent to my total sale like this:

 

       
  2016 Measure

2016

Sales

2017 Measure2017 Sales2018 Measure2018 SalesTOTAL MeasureTOTAL Sales Participation   percentage  
Sport 26 items1260059 items3700052 items3500068 items84600100%  
 water sport18560032240003020000384960059%  
 diving 72600101500012100001327600 33% 
 snorkle7 (items260010 (items1500012 (items1000013 (items27600  33%
 Surfing11300022900018100002522000 26% 
 wax6(items100010(items40009(items800010(items13000  15%
 surfboard5(items200012 (items50009(items200015 (items9000  11%
 Land Sport8700027130002215000303500041%  
 football540001580001870002019000 22% 
 ball5(items400015(items800018(items700020(items19000  22%
 basketball33000105000680001016000 19% 
 jersey3(items300010(items50006(items800010(items16000  19%

 

 

I have done this in excel before.  but i am having a difficult time doing it in bi because it is not cell oriented.

 

Thanks in advance for the help.

Hi,

 

I do not understand.  Please share your actual dataset and show the expected result.


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

Hello Ashish,

 

The dataset is too large too share, i am sending an excel replica

EXAMPLE.JPG

 

The result i want is this: (Keep in mind the red area)

EXAMPLE2.JPG

 

 

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.