Forum Discussion
Count Measure Values
- 4 years ago
"i change to use calculated column"
Why? I thought your goal was to do everything with measures?
Here is the formula for the calculated column version:
Column Group = SWITCH(TRUE(), ISBLANK([PY SalesAmount]) && ISBLANK([SalesAmount]),"Inactive", ISBLANK([PY SalesAmount]) && not ISBLANK([SalesAmount]),"New", not ISBLANK([PY SalesAmount]) && ISBLANK([SalesAmount]),"Lost", [SalesAmount]>[PY SalesAmount],"Increasing", [SalesAmount]<[PY SalesAmount],"Declining", "Same")
Hi Ibendlin,
It's worked, thankyou so much! Appreciate.
- lbendlin4 years agoSuper User
Glad to hear. Just to reiterate - you cannot count measure values. You need to formulate the business requirement and then write another measure that implements the associated logic.
Also note that my first measure is not fully covering all scenarios. (for example when both current and previous year values are blank). Adjust as needed.
- Huei4 years agoFrequent Visitor
Okay, noted. I will check first measure. But i still having problem here, i change to use calculated column for TY sales amount and PY sales amount, but the PY Sales amount show blank. Can you please advise?
Thanks.
- lbendlin4 years agoSuper User
"i change to use calculated column"
Why? I thought your goal was to do everything with measures?
Here is the formula for the calculated column version:
Column Group = SWITCH(TRUE(), ISBLANK([PY SalesAmount]) && ISBLANK([SalesAmount]),"Inactive", ISBLANK([PY SalesAmount]) && not ISBLANK([SalesAmount]),"New", not ISBLANK([PY SalesAmount]) && ISBLANK([SalesAmount]),"Lost", [SalesAmount]>[PY SalesAmount],"Increasing", [SalesAmount]<[PY SalesAmount],"Declining", "Same")