Hi,
As calculated columns are being discontinued in favour of formulas - I need help recreating this simple task via a formula (See attached image of how I used a calculated column.)
In my model driven app, I have a simple global, choice column called "Significance", with 5 choices - International, National, State, Regional, Local.
I need a column that codifies/quantifies these categories, according their scope, into whole numbers - so International = 5, National = 4 etc.. So that I can graph them in a Chart in my App. (I can't find any way of accessing the values I assigned to these choices when I created them)
In creating a new column using "Formula", I've tried many different formulas, but each gives error messages (here's 3 examples):
If(Significance=Blank(),"",Significance ="International",5,Significance="National",4,Significance ="State",3,Significance="Regional",2,Significance="Local",1)
Switch(Significance,"International","5","National","4","State","3","Regional","2","Local","1","")
Switch(ThisItem.Significance,'Significance(Aim)'.'International',5,'Significance(Aim)'.'National',4,'Significance(Aim)'.'State',3,'Significance(Aim)'.'Regional',2,'Significance(Aim)'.'Local',1)
Please help!
NB: "This.Item" doesn't seem to be an available formula in Model driven Power Fx...
NBB. I was able to do this easily with calculated columns, but when I attempt this I message "The Calculated behaviour will eventually be discontinued. We recommend using the Formula data type for calculations instead" so need the capacity to do this via a Formula.
Unfortunately, this also results in the same error message..
Maybe you can't create a formula data type that relies on a choice column??? (But I also had the same issues when trying to create a formula using a lookup column)..
Noting, I don't experience any issues when coding choice column using the calculated fields....
I need Microsoft to fix this issue BEFORE they discontinue calculated fields..
hey @Dtrain2024
can u try the switch function:
Switch(
Significance,
"International", 5,
"National", 4,
"State", 3,
"Regional", 2,
"Local", 1,
Blank()
)
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional