The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
MEASURE = CALCULATE ( DISTINCTCOUNT ( Table1[ Col B] ), Table1[ Col B] <> BLANK () )
Hi,
Try these measures
=DISTINCTCOUNT(Data[column1])
and
=DISTINCTCOUNT(Data[column2])
@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.
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" )