Forum Discussion
Anonymous
6 years agoNot applicable
Need help in adding a calculated column
Hi I want to show the count of Exotic and Non Exotic Fruits and Vegetables. While I got the solution to count Exotic, I need help in counting the non exotic ones. I have an added table and there is ...
- Anonymous6 years ago
Hi Anonymous ,
Non Exotic Col = if('Table'[Type] in {"Fruit","Vegetable"} && 'Table'[Sub Category] <> "Exotic",1,0)NonEXoctic COunt = VAR Fruits = COUNTX ( FILTER ( 'Table', 'Table'[Type] IN { "Fruit" } && 'Table'[Sub Category] <> "Exotic" ), 'Table'[Type] ) VAR veg = COUNTX ( FILTER ( 'Table', 'Table'[Type] IN { "Vegetable" } && 'Table'[Sub Category] <> "Exotic" ), 'Table'[Type] ) RETURN SWITCH ( TRUE (), 'Table'[Type] = "Fruit" && 'Table'[Sub Category] = "Non Exotic", Fruits, 'Table'[Type] = "Vegetable" && 'Table'[Sub Category] = "Non Exotic", veg, BLANK () )Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)Did I answer your question? Mark my post as a solution!
az38
6 years agoCommunity Champion
Hi Anonymous
try
Measure =
CALCULATE(COUNTROWS('My_Farm_Data'),
'My_Farm_Data'[Type] IN {"Fruit", "Vegetable"}, 'My_Farm_Data'[Sub Category] <> "Exotic"
)