Forum Discussion
rcb0325
5 years agoHelper I
Converting If/else statements from Excel
I have a table that I am trying to figure out the DAX input for. The formula in excel was: =if([Invoice Account]="112541",.11,IF([Customer Rebate Group]="TDG",.07,IF(OR([Invoice Account]="139871...
- 5 years ago
Hi rcb0325 ,
You could modify measure by the following formula:Rebate Multiplier = IF ( MAX ( [BillToCustomerCustomerNumber] ) = "112541", .11, IF ( MAX ( [BillToCustomerCustomerRebateGroup] ) = "TDG", .07, IF ( MAX ( [BillToCustomerCustomerNumber] ) = "139871" || MAX ( [BillToCustomerCustomerNumber] ) = "131324", .08, .07)))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rcb0325
5 years agoHelper I
When I type out the DAX, and replace the fields with what they should be, it is not allowing me to use them. (highlighted below).
Is there a certain format that the field has to be in?
=IF([BillToCustomerCustomerNumber]="112541",.11,IF([BillToCustomerCustomerRebateGroup]="TDG",.07,IF(OR([BillToCustomerCustomerNumber]="139871",[BillToCustomerCustomerNumber]="131324"),.08,.07)))
- Ashish_Mathur5 years agoSuper User
Hi,
It should be written as a calculated column formula (not as a measure). Also, the best practise is to precede the column name with the table name.