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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count The Number of subcategories in matrix

I want to count the number of subcategories. Data looks like below:

 

 

Rank     			Vendor Group
Elite	       		Avot
Elite	           	Ivak
Essential			Boch LTD
Essential			Futh Elec
Provisional			Active Dach
Provisional			Alloc Mac
Provisional			Alldoc
Provisional			Anpro
Provisional			Falow
Provisional			Match
Provisional			Beast Elec

 

 

The data above is a matrix. Vendor group is a column that comes from Vendor Info Table and Rank is a measure calculated based on their score calculated using another measure. I want to count how many Elites and how many Provissonals we have in different card or table. How can I do this please?

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

First create a dim table as below:

v-kelly-msft_0-1621411919932.png

Then create a measure as below:

Measure 2 = 
SWITCH(SELECTEDVALUE('Dim table'[Column1]),"Elite",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Elite")),
"Essential",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Essential")),
"Provisional",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Provisional")))

Finally you will see:

v-kelly-msft_1-1621411964645.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Surafel_0-1620258346644.png

I am only getting the total number of vendor groups as shown in snippet above. 

Hi @Anonymous ,

 

First create a dim table as below:

v-kelly-msft_0-1621411919932.png

Then create a measure as below:

Measure 2 = 
SWITCH(SELECTEDVALUE('Dim table'[Column1]),"Elite",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Elite")),
"Essential",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Essential")),
"Provisional",CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Measure]="Provisional")))

Finally you will see:

v-kelly-msft_1-1621411964645.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

samdthompson
Memorable Member
Memorable Member

Hello, try making this measure:

 

=COUNTROWS(Table)

 

here it is at work:

2021-05-06_11-34-15.jpg

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.