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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Haya
Helper II
Helper II

Card visualizer count distinct without blank

I have card visualizer that count disctict values in a single colunm, However, it calculates blank value that I want to exclude.

I tried to use visual filter but the dropdown of the filter is not clickable.

1 ACCEPTED SOLUTION

Hi @Haya,

Please try to create one measure as below:

Measure = CALCULATE(DISTINCTCOUNT('Table'[Name]),NOT(ISBLANK('Table'[Name]))&&TRIM('Table'[Name])<>"")

card count distinct without blank.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

@Haya 

try:

Count distinct = COUNTROWS(VALUES(table [column])




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

The information you have provided is not making the problem clear to me. Can you please explain with an example. If possible please share a sample pbix file after removing sensitive information.
Thanks.

My Recent Blog -
Time Intelligence - Direct Query

NameID
  
Sara1
Haya2
Hana3
Haya1
Hana3

 

When I use "card" visualizer, count distinct Name, the output become 4 because it calculates the empty cell (blank). the output should be 3.

 

I believe amitchandak formula will work to ignore to blank values. I don't know why is not working for you.

 

try 

 

CALCULATE(DISTINCTCOUNT(Table1[Name]),FILTER(Table1,NOT(ISBLANK(Sheet1[Name]))))

Try

calculate(distinctcount(Table[Name]),not(isblank(Table[Name])))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

I've tried but the same

Hi @Haya,

Please try to create one measure as below:

Measure = CALCULATE(DISTINCTCOUNT('Table'[Name]),NOT(ISBLANK('Table'[Name]))&&TRIM('Table'[Name])<>"")

card count distinct without blank.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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