Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
5 years ago
Solved

formula dax

Well, I need a formula to solve this problem.

As you observe I have a number of customers, these in terms of rate have two options that have group rate or what have customer rate, you can realize the case that has both, always imposes the customer rate.

As for the idem discount, you may notice that they have the two columns reported (Dcto group and Dcto customer), always prevailing the dcto customer.

In addition it can happen that a customer has rate group and dcto customer and also that a customer has customer rate and dcto group.

customergroup rateCustomer rateDcto Group Dcto clientresult
150104
205014
350023
405203
553201
653021
753212
  • Syndicate_Admin 

    Not sure this is what you are looking for.

    Rate = 
    IF (
        NOT ISINSCOPE ( 'Table'[customer] ),
        BLANK (),
        SUMX (
            'Table',
            IF ( 'Table'[Customer rate] = 0, 'Table'[group rate], 'Table'[Customer rate] )
        )
    )
    Dcto = 
    IF (
        NOT ISINSCOPE ( 'Table'[customer] ),
        BLANK (),
        SUMX (
            'Table',
            IF ( 'Table'[Dcto client] = 0, 'Table'[Dcto Group], 'Table'[Dcto client] )
        )
    )

    If this is not what you are looking for please provide an example of the expected output and logic for how you got it.

     

     

1 Reply

  • Syndicate_Admin 

    Not sure this is what you are looking for.

    Rate = 
    IF (
        NOT ISINSCOPE ( 'Table'[customer] ),
        BLANK (),
        SUMX (
            'Table',
            IF ( 'Table'[Customer rate] = 0, 'Table'[group rate], 'Table'[Customer rate] )
        )
    )
    Dcto = 
    IF (
        NOT ISINSCOPE ( 'Table'[customer] ),
        BLANK (),
        SUMX (
            'Table',
            IF ( 'Table'[Dcto client] = 0, 'Table'[Dcto Group], 'Table'[Dcto client] )
        )
    )

    If this is not what you are looking for please provide an example of the expected output and logic for how you got it.