Forum Discussion
Anonymous
7 years agoNot applicable
Count( if column value = string)
Hi, Having trouble with DAX syntax in if statements for checking if a column's string value equals a certain value. I want to do some calculations using different counts of strings, such as: CO...
- 7 years ago
Anonymous add new measure with following expression
MyBalanceCount = CALCULATE( COUNTROWS( MyTable ), MyTable[Location] = "In Storage" ) - CALCULATE( COUNTROWS( MyTable ), MyTable[Location] = "Out Storage" )
suhasakole
7 years agoFrequent Visitor
Hi Ben,
Along with the above approach, you can try the following creating 2 calculated measure and then use those in creating a final measure. Hope this might help you.
CntRowsInStorage = CALCULATETABLE(ROW("rows",COUNT(Table[Location])),FILTER(ALL(Table[Location]),SEARCH("In Storage",Table1[Text],1,0)))
CntRowsOutStorage = CALCULATETABLE(ROW("rows",COUNT(Table[Location])),FILTER(ALL(Table[Location]),SEARCH("Out Storage",Table1[Text],1,0)))
FinalCount = CntRowsInStorage - CntRowsOutStorage