Forum Discussion
Matas
4 years agoAdvocate II
Calculations using DAX
Hi guys, I am having a table with 18k+ rows, but it is only 715 unique (DISTINCT) ID's, which means only 715 unique documents with different ID's. I am trying to get the "Extracted" values, which...
- 4 years ago
Matas
Please tryExtracted = VAR T1 = VALUES ( TableName[DOCID] ) VAR T2 = ADDCOLUMNS ( T1, "@NumOfBlanks", SUMX ( CALCULATETABLE ( TableName ), IF ( TableName[Value] = BLANK (), 1 ) ) ) VAR T3 = FILTER ( T2, [@NumOfBlanks] = BLANK () ) RETURN COUNTROWS ( T3 )Blanks = VAR T1 = VALUES ( TableName[DOCID] ) VAR T2 = ADDCOLUMNS ( T1, "@NumOfBlanks", SUMX ( CALCULATETABLE ( TableName ), IF ( TableName[Value] = BLANK (), 1 ) ) ) VAR T3 = FILTER ( T2, [@NumOfBlanks] <> BLANK () ) RETURN COUNTROWS ( T3 )
tamerj1
4 years agoCommunity Champion
Matas
I think we're saying the same thing but in different languages. What are you slicing by in you chart?
Matas
4 years agoAdvocate II
Just to clarify, I think my issue is that calculations are being made by taking whole data from the table and not Distinct values, since if I am applying just Count on my Document ID's, this is the result, since I have multiple rows with same ID, since other columns contains different values:
The calculations should be made according to the Distinct ID's, which is: