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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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