Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

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
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@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] )
    )
)

jdbuchanan71_0-1623081105993.png

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

 

 

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

@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] )
    )
)

jdbuchanan71_0-1623081105993.png

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

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.