Forum Discussion
Anonymous
4 years agoNot applicable
Distinct COuntx
Hi Team, I havae a dataset where i need to get distinct count of projectid where filter condition on cloumn Met/Not Met = "Met" However this dax is not working as i need unique projectid and i am g...
- Anonymous4 years ago
Hi Anonymous ,
Create a new table with the following dax expression.
NewTable = SUMMARIZE ( 'Table', 'Table'[Project ID], "Met", CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Met/not met] = "Met" ), "Not Met", CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Met/not met] = "Not Met" ) )Then create two new columns based on this.
Grand Total = 'NewTable'[Met]+'NewTable'[Not Met]Condition = IF('NewTable'[Met]='NewTable'[Grand Total],1,0)Finally create a measure.
count 1 = CALCULATE(COUNTROWS('NewTable'),FILTER('NewTable','NewTable'[Condition]=1))specific value = VAR _condition_all = CALCULATE(COUNTROWS('NewTable')) RETURN [count 1]/_condition_allThe result should be like this.
Attach the pbix file for reference. Hope it helps.
Best Regards,
Community Support Team_Gao
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Anonymous
4 years agoNot applicable
Actually i tried all those steps and it is not matching with the requirement.
Let me rephrase it one more time
Consider below table
| Project ID | Met | Not Met | Grand Total | Condition = If (Met = Grand Total), 1,0) |
| 10030-01 | 2 | 2 | 1 | |
| 10077-03 | 5 | 5 | 1 | |
| 10093-02 | 8 | 8 | 1 | |
| 10098-01 | 9 | 9 | 1 | |
| 1010-01 | 42 | 42 | 1 | |
| 10119-01 | 13 | 13 | 1 | |
| 10142-01 | 5 | 5 | 1 | |
| 10162-01 | 5 | 2 | 7 | 0 |
| 10310-02 | 7 | 7 | 1 | |
| 10331-04 | 8 | 8 | 1 | |
| 10352-04 | 2 | 2 | 4 | 0 |
| 10376-01 | 12 | 12 | 1 | |
| 10379-02 | 5 | 5 | 1 |
Now i want to count how many 1 and total sum i.e, 11/13