Issue when using IFS expression

I have an issue when trying to use the IFS expression to perform calculations using the Order Capture Sample app. The expression to calculate totals on the Order Details table is as follows: [Product Id].[Price] * [Quantity]. This expression is used for all products. However, I am trying to customize the app so that each product has a unique calculation. When I enter the following expression: IFS([Product Id]=โ€œStrawberryโ€,[Product Id].[Price][Quantity].02,[Product Id]=โ€œKiwiโ€,[Product Id].[Price] * [Quantity] * .05,[Product Id]=โ€œRaspberryโ€,[Product Id].[Price] * [Quantity] * .2) the Total disappears from the UX and no total is calculated. Any Suggestions?

Solved Solved
0 9 207
1 ACCEPTED SOLUTION

I actually just figured it out. I was using an incorrect reference.

View solution in original post

9 REPLIES 9

Try setting a default case IE IFS(Exp1,Result1,Exp2,Result2,true,โ€œDefaultโ€)
This will tell you if the problem is in your Exp statements or in the formulas. If it doesnโ€™t make it to the Default then your Result expressions are giving the error and if you make it to the Default then the Exp statements are wrong.

I set the default and the Total was instantly filled in with my default case. It appears that the Total switched to requiring a user input instead of making a calculation.

My guess is that your Product Name is not the same as your Product Id. Try using something like this:

[Product Id].[Product Name]=โ€œStrawberryโ€

I made the change to Product Name and had no success. If I use a simple formula that does not include the IFS, then it works fine. The issue occurs when using the IFS expression.

Letโ€™s get some screenshots of your data.

Steve
Platinum 4
Platinum 4

Precede all decimal points with a 0 (e.g., .02 should be 0.02).

I placed the zero in front of my decimals. The issue still exists. If I use a simple IF expression, the calculation takes place and the column is completed. If I use an IFS expression, the calculation does not take place and the โ€œTotalโ€ column is not completed. I am using the sample app โ€œOrder Capture.โ€ Could the issue be caused by the Ref_Rows expressions or the virtual columns?

Please post screenshots of the working expression and the non-working expression.

I actually just figured it out. I was using an incorrect reference.

Top Labels in this Space