Forum Discussion
pbi_girl_21
2 years agoNew Member
Counting Products based on Indicator
Hi Everyone, I have a complex calcuation I can't seem to figure out! I have a table of data with grocery store names and products. The products are fruits, veggies, meat etc... but I only car...
- 2 years ago
hi pbi_girl_21
You can use these Measures.
Fruit Count =VAR _FruitCount = CALCULATE(DISTINCTCOUNT(Fruits[Product]), Fruits[Fruit Indicator] = 1)RETURN IF( ISBLANK(_FruitCount), 0 , _FruitCount)Fruits =VAR _FruitCount = [Fruit Count]RETURN IF(_FruitCount = 1, CALCULATE( VALUES(Fruits[Product]), Fruits[Fruit Indicator] = 1) , BLANK())You can also show all the fruits in a Store if that is the requirement.
talespin
Solution Sage
2 years agohi pbi_girl_21
You can use these Measures.
Fruit Count =
VAR _FruitCount = CALCULATE(DISTINCTCOUNT(Fruits[Product]), Fruits[Fruit Indicator] = 1)
RETURN IF( ISBLANK(_FruitCount), 0 , _FruitCount)
Fruits =
VAR _FruitCount = [Fruit Count]
RETURN IF(_FruitCount = 1, CALCULATE( VALUES(Fruits[Product]), Fruits[Fruit Indicator] = 1) , BLANK())
You can also show all the fruits in a Store if that is the requirement.