cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## How to make "if conditions" in CDS work like Excel "if conditions" : Calculated fields

I have been trying to achieve the following in a if condition in a calulated field , Could you please help me the achieve this kind of values which are dynamic.

By default the if condition only allows a "static value" or a "field value " , is there any way i can have a computed "field value" as follows , this is the formula based on excel , i need to achieve the same in CDS calculated fields

```=IF(
BX\$4 <= \$AI5,
IF(
OR(
BX\$4 = \$AH5 + 1,
BX\$4 = \$AH5 * 2 + 1,
BX\$4 = \$AH5 * 3 + 1,
BX\$4 = \$AH5 * 4 + 1,
BX\$4 = \$AH5 * 5 + 1,
BX\$4 = \$AH5 * 6 + 1,
BX\$4 = \$AH5 * 7 + 1,
BX\$4 = \$AH5 * 8 + 1,
BX\$4 = \$AH5 * 9 + 1,
BX\$4 = \$AH5 * 10 + 1,
BX\$4 = \$AH5 * 11 + 1,
BX\$4 = \$AH5 * 12 + 1,
BX\$4 = \$AH5 * 13 + 1,
BX\$4 = \$AH5 * 14 + 1,
BX\$4 = \$AH5 * 15 + 1,
BX\$4 = \$AH5 * 16 + 1,
BX\$4 = \$AH5 * 17 + 1,
BX\$4 = \$AH5 * 18 + 1,
BX\$4 = \$AH5 * 19 + 1,
BX\$4 = \$AH5 * 20 + 1
),
BW5 * ( 1 + \$AE5 ),
BW5
),
0
) ```
2 REPLIES 2
Memorable Member

Create a plugin that do these calculated when a record is created. So, that the expected field acts like calculated field. You can run flows as well but Plugins are more robust.

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/plugin-develop...

Most Valuable Professional

Hi @Anonymous,

Possible to get a little bit more info on the requirements instead of the formula? Reason I'm asking is maybe there's an easier way to achieve it using out-of-the-box features instead of coding like in the previous post.

Thanks

Announcements

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA