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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
DataForge_88
New Member

Priority Based Sales Rep Assignment

Hello everyone,

I’m currently working on determining the most effective way to assign sales to the appropriate sales representative.

The challenge is that each of the three business units uses a different method for assigning sales, and within those units, individual segments may follow their own distinct rules as well.

What would be the best approach to handle this?

Some examples of the current assignment methods include:

- Proprietary SKUs → Sales rep (This should always be rule #1)
- Business Unit → Ship-to → Sales rep
- Business Unit → Territory → Sales rep 
- Any sale not captured
                   - (This will serve as a fallback for any cases not captured by the rules above; however, it should be minimal, as the                                  primary rules are expected to cover the majority of scenarios.)

1 ACCEPTED SOLUTION
Zanqueta
Super User
Super User

Hello @DataForge_88 

 

The best approach is to create a priority‑based rule engine. Each rule has a defined priority and criteria, and sales are assigned according to the first rule that applies. This ensures consistent results, supports multiple business units with different methods, and provides a clear fallback for unmatched cases. The approach is scalable, transparent, and easy to maintain.


You can build a rule table that contains:
A priority number (1 is highest)
A rule type (SKU, Ship‑to, Territory, and so on)
The criteria for the rule
The Sales Representative to assign
For example:
Priority 1: Proprietary SKU → Sales Rep
Priority 2: Business Unit → Ship‑to → Sales Rep
Priority 3: Business Unit → Territory → Sales Rep
Priority 99: Fallback for any sale not captured by previous rules
Using priority numbers ensures that the system always respects the most important conditions first, such as “Proprietary SKU”.
 
Priority Rule Type Condition Sales Rep
1 Proprietary SKU SKU in ProprietaryList Rep A
2 BU → Ship‑to BU = X AND ShipTo = Y Rep B
3 BU → Territory BU = X AND Territory = Z Rep C
99 Fallback Always TRUE Default Rep
 
This method can be implemented in Power BI (Power Query or DAX) or directly in your data warehouse.
The general rule is:
Check Rule 1
If it does not match, check Rule 2
If that also does not match, check Rule 3
If none match, apply the fallback rule
This structure is much easier to maintain than embedding several conditional statements in DAX
 

Assigned Sales Rep :=
VAR Rule1 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 1,
        Sales[SKU] IN VALUES(RuleTable[SKU])
    )
 

VAR Rule2 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 2,
        Sales[BusinessUnit] = RuleTable[BusinessUnit],
        Sales[ShipTo] = RuleTable[ShipTo]
    )
 

VAR Rule3 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 3,
        Sales[BusinessUnit] = RuleTable[BusinessUnit],
        Sales[Territory] = RuleTable[Territory]
    )
 

RETURN
    COALESCE(Rule1, Rule2, Rule3, "Fallback Rep")

 

 

 

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn

View solution in original post

4 REPLIES 4
Poojara_D12
Super User
Super User

Hi @DataForge_88 

I think the way to handle this is to stop trying to manage the logic through complex DAX and instead centralize everything into a single rule-based mapping table that defines how sales should be assigned. Each rule (SKU-based, Ship-to, Territory, etc.) should be stored as rows in this table along with a priority column, where the most important rule—like Proprietary SKU—is given the highest priority. Then, during data preparation (preferably in Power Query), you match each sales record against this table and assign the sales rep based on the first rule that matches according to priority. This approach ensures consistency across all business units and segments, keeps the logic transparent and easy to maintain, and avoids messy nested conditions in DAX. The fallback rule simply captures anything not matched earlier, but if your mapping is well-designed, it should rarely be used.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
v-karpurapud
Community Support
Community Support

Hi @DataForge_88 

We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank You.

 

v-karpurapud
Community Support
Community Support

Hi @DataForge_88 

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @Zanqueta  for those inputs on this thread.

Could you let us know if the suggested solution resolved your issue? If not, please share any additional details so we can assist further.

Best regards,
Community Support Team.


Zanqueta
Super User
Super User

Hello @DataForge_88 

 

The best approach is to create a priority‑based rule engine. Each rule has a defined priority and criteria, and sales are assigned according to the first rule that applies. This ensures consistent results, supports multiple business units with different methods, and provides a clear fallback for unmatched cases. The approach is scalable, transparent, and easy to maintain.


You can build a rule table that contains:
A priority number (1 is highest)
A rule type (SKU, Ship‑to, Territory, and so on)
The criteria for the rule
The Sales Representative to assign
For example:
Priority 1: Proprietary SKU → Sales Rep
Priority 2: Business Unit → Ship‑to → Sales Rep
Priority 3: Business Unit → Territory → Sales Rep
Priority 99: Fallback for any sale not captured by previous rules
Using priority numbers ensures that the system always respects the most important conditions first, such as “Proprietary SKU”.
 
Priority Rule Type Condition Sales Rep
1 Proprietary SKU SKU in ProprietaryList Rep A
2 BU → Ship‑to BU = X AND ShipTo = Y Rep B
3 BU → Territory BU = X AND Territory = Z Rep C
99 Fallback Always TRUE Default Rep
 
This method can be implemented in Power BI (Power Query or DAX) or directly in your data warehouse.
The general rule is:
Check Rule 1
If it does not match, check Rule 2
If that also does not match, check Rule 3
If none match, apply the fallback rule
This structure is much easier to maintain than embedding several conditional statements in DAX
 

Assigned Sales Rep :=
VAR Rule1 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 1,
        Sales[SKU] IN VALUES(RuleTable[SKU])
    )
 

VAR Rule2 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 2,
        Sales[BusinessUnit] = RuleTable[BusinessUnit],
        Sales[ShipTo] = RuleTable[ShipTo]
    )
 

VAR Rule3 =
    CALCULATE(
        MAX(RuleTable[SalesRep]),
        RuleTable[Priority] = 3,
        Sales[BusinessUnit] = RuleTable[BusinessUnit],
        Sales[Territory] = RuleTable[Territory]
    )
 

RETURN
    COALESCE(Rule1, Rule2, Rule3, "Fallback Rep")

 

 

 

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.