Forum Discussion
Best Way to Create Column that First Calculates Range, then Assigns Value
- Anonymous2 years ago
Hi rosamhernandez1 ,
We can add two conditional columns.
Then we add three custom columns.
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi rosamhernandez1 ,
Based on your description, we can create three columns.
CostHealth = SWITCH(TRUE(),
[RATE]<25 && [CostDiff]>[RATE]*2,"Yellow",
[CostDiff]<[RATE]*2,"Green",
[RATE]>=25 && [RATE]<=100 && [CostDiff] >5,"Yellow",
[CostDiff]<5,"Green",
[RATE]<100 && [CostDiff]>20,"Yellow",
[CostDiff] <20,"Green")variance_max =
SWITCH(TRUE(),
[APE]<25,[RATE]+ [RATE] * 0.2,
[APE] >=25 && [APE]<=100,[RATE]+5,
[APE]>100,[RATE]+20)variance_min =
SWITCH(TRUE(),
[APE]<25,[RATE]- [RATE] * 0.2,
[APE] >=25 && [APE]<=100,[RATE]-5,
[APE]>100,[RATE]-20)
Then the result is as follows.
If I have misinterpreted your needs, please clarify in a follow-up response, preferably with an example of your desired outcome.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thank you, I am not familiar with DAX and have been using M query to add columns as of now, is there a way to translate this into M?
- Anonymous2 years agoNot applicable
Hi rosamhernandez1 ,
We can add two conditional columns.
Then we add three custom columns.
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- rosamhernandez12 years ago
Helper I
Anonymous thank you! this did the trick, much appreciated!