Forum Discussion
pb202134
4 years agoRegular Visitor
calculated column for account status
I have created a simple calculated column that classifies customers based on when they made their last order into the following: Last order: within last 90 days: active between 91 and 180 da...
- 4 years ago
pb202134 you referred to me as Greg_Deckler , try this, the one I gave you was for Calculated column as I thought you needed a calculated column
Column = VAR _cal = TODAY () - MAX(Sales[Last transaction date]) VAR _switch = SWITCH ( TRUE (), _cal <= 90, "active", _cal > 91 && _cal <= 180, "lapsing", _cal > 181 && _cal <= 360, "lapsed", "dormant" ) RETURN _switch
smpa01
Community Champion
4 years agopb202134 you referred to me as Greg_Deckler , try this, the one I gave you was for Calculated column as I thought you needed a calculated column
Column =
VAR _cal =
TODAY () - MAX(Sales[Last transaction date])
VAR _switch =
SWITCH (
TRUE (),
_cal <= 90, "active",
_cal > 91
&& _cal <= 180, "lapsing",
_cal > 181
&& _cal <= 360, "lapsed",
"dormant"
)
RETURN
_switch