Forum Discussion
AnaPiedade
5 years agoRegular Visitor
Count distinct values plus count each blank one time DAX
Hello, I have a column with purchase document numbers. They can be blank or have a number that can appear repeated in several rows. I want to count the repeat values one times and each blank als...
camargos88
Community Champion
5 years agoAnaPiedade
5 years agoRegular Visitor
Hello camargos88,
Thank you for the suggestion. Although this function is only counting blanks and gives me a much bigger number for the blanks I have.
purchdoc
1
1
2
blank
blank
My desired outcome is 4 for the example above.
- camargos885 years ago
Community Champion
- Anonymous5 years agoNot applicable
AnaPiedade
You can use DISTINCTCOUNTNOBLANK() funtion to get the nonblank values, and then add the count of blanks to it with COUNTBLANK(), so it is 2 + 2 = 4.Measure = DISTINCTCOUNTNOBLANK('Table'[Column1])+COUNTBLANK('Table'[Column1])
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.