Forum Discussion
Anonymous
4 years agoNot applicable
Help needed with DAX
I am new to DAX functions and would appreciate your help. My formula works partially. I want to count the number of rows that are repeated but I want 0 where there is no number. Formula ...
- Anonymous4 years ago
Anonymous
You can create a measure, if an ID is repeated show the count of the ID otherwise return 0.
CountIfRepeat = IF(COUNT([ID])>1,CALCULATE(COUNT('Table'[ID]),FILTER(ALL('Table'),[ID]=MAX([ID]))),0)Best regards
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
4 years agoAnonymous Text data please.
Anonymous
4 years agoNot applicable
| Power Query Editor | ||
| ID | Extension ID | Conditional Column |
| A1 | 0 | |
| B2 | 0 | |
| C3 | 11 | C3 |
| C3 | 12 | C3 |
| D4 | 0 | |
| E5 | 13 | E5 |
| E5 | 14 | E5 |
| E5 | 15 | E5 |
| F6 | 0 | |
| G7 | 16 | G7 |
| G7 | 17 | G7 |
Conditional column is formatted field - if Extenson ID is 0 then 0 else (select column) ID
| Desired Output | |
| ID | # of Extensions |
| A1 | 0 |
| B2 | 0 |
| C3 | 2 |
| D4 | 0 |
| E5 | 3 |
| F6 | 0 |
| G7 | 2 |