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! Learn more

Reply
lkrishnaprasad
Frequent Visitor

Wrong Total when I count the merged table column

I have created a simple table like

 

 Col A | Col B

---------------

PBI1 | INC1

PBI1 | INC2

PBI1 | INC3

PBI2 | INC4

PBI2 | null

PBI3 | null

PBI3 | null

-----------

 

I want the total distinct count of ColA to be 3 and distinct count of Col B to be 4.

Col A | Col B

--------------

3        |   4

 

please help

1 ACCEPTED SOLUTION

@lkrishnaprasad

 

 

MEASURE =
CALCULATE ( DISTINCTCOUNT ( Table1[ Col B] ), Table1[ Col B] <> BLANK () )

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Try these measures

 

=DISTINCTCOUNT(Data[column1])

 

and

 

=DISTINCTCOUNT(Data[column2])


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

@Ashish_Mathur, this will give only the count in the Total correct but still shows numbers for the blank record in the rows. What I got from @Zubair_Muhammad is the right measure I wanted. 

@lkrishnaprasad

 

 

MEASURE =
CALCULATE ( DISTINCTCOUNT ( Table1[ Col B] ), Table1[ Col B] <> BLANK () )

Thanks a lot, Zubair. This is what I wanted. With the replaced value I changed the null value to NoData and change the measure accordingly. This worked. Thank you.

 

count right = CALCULATE ( DISTINCTCOUNT ( Merge1[Table4.Column1] ), Merge1[Table4.Column1] <> "NoData" ) 

Helpful resources

Announcements
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!

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.

Top Solution Authors