Forum Discussion
Calculations using DAX
- 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 )
Hi Matas
so you are trying to calculate the number of document that have at least one blank. Also the the number of documents that have no blanks at all. Or the final goal is to calculate directly the documents that have no blanks at all?
- Matas4 years agoAdvocate II
Hi tamerj1
Thank you for reply. My end goal is to show the Extracted and Blank values based on number of Distinct ID's categorized into separate fields.
Extracted means that my Column "VALUE" has any value, as long it is not null or Blank.
Blank, well it literally means Blank inside of "VALUE" column.
The solution should be that somehow I should calculate the Extracted and Blanks based on Distinct ID. Since my total number of distinct ID's is 715 documents, this graph maximum point should be 715. But depending on the Extracted and Blanks, it can be let's say 658 Extracted and 57 Blanks or so.
Hopefully I have not confused you even more.
Regards,
Matas