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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
menik_sun
Regular Visitor

Distinct count excluding blank rows in a matrix

Chart is like below

Contract TypeNosDesignationLocation
Permanent1Manager 1London
Permanent1Manager 1Paris
Permanent1Manager 1New York
Permanent2Manager 1Brussels
Permanent2Manager 1Amsterdam
Permanent3Worker 1Washington DC
Permanent3Worker 1London
Permanent3Worker 1Paris
Permanent3Worker 1Brussels
Contract Worker 2Amsterdam
Contract Worker 3New York
Contract Worker 4London
Contract Worker 5New York
Contract Worker 5Washington DC

 

First Formula Required: Count of Nos
Distinct Count of No excluding Blanks
for above chart, outcome should be 3 (unique count of 1, 2 & 3)

Second Formula Required: Count of Designation
Distint Count of Designation
for above chart, outcome should be 6

 

At the end, if I can get a table like below, it would be of great help:

 

Contract TypeCount of NosCount of Designation
Permanent32
Contract44
Total76
3 REPLIES 3
Anonymous
Not applicable

Hi @menik_sun ,

 

Please try the following measures:

 

first formula - COUNTROWS(SUMMARIZE(Table, Table[ContractType], Table[Desgination], Table[Nos]))

second formula - COUNTROWS(SUMMARIZE(Table, Table[ContractType], Table[Designation]))

 

I arrived at the following matrix using ContractType in Rows.

sktoh86_0-1620358017621.png

 

Cheers

 

amitchandak
Super User
Super User

@menik_sun , You can try measure like

 

three examples

 

calculate(distinctcount(Table[Nos]), filter(Table, not(isblank([Nos]))))

 

calculate(distinctcount(Table[Designation]), filter(Table, not(isblank([Nos]))))

 

calculate(distinctcount(Table[Designation]), filter(Table, not(isblank([Designation]))))

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

Thanks for your reply @amitchandak . It's showing correct total but not while using field dimension. It is showing total result even after using field as rows.

 

Below is what I get after using the formula:

 

Thanks for your reply @amitchandak . It's showing correct total but not while using field dimension. It is showing total result even after using field as rows.

 

Below is what I get after using the formula:


                              With suggested formula         Formula required for
Contract Type             Count of Nos                     Count of Nos
Permanent                           7                                          3
Contract                              7                                          4
Total                                    7                                          7

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.