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.
Hello! I'm looking to count distinct sales rep by summarized commission values. I have page slicers such as date and plan so I'm trying to keep this dynamic. Anytime I try to get a count of sales rep by commission it rolls into one large sum or breaks out by customerID instead of Sales Rep.
Example Table:
This is what I keep getting in PowerBI:
This is my desired result:
The end goal will be to get a count of sales rep in buckets of "Less than 300","Less than 500","Less than 700", etc. this is a simplified example
Any suggestions?
Solved! Go to Solution.
Hi @sarhutson
In my view, to achieve this we need to create a calculated column (grouped by name) and a measure.
I have mocked up the table name to be "Commission data" and sales rep to be "Name" and below are the codes.
1) Calculated column
grouped by name =
var _name = 'Commission data'[Name]
var _value = SUMX(FILTER('Commission data','Commission data'[Name] = _name),'Commission data'[Commission])
return
SWITCH(TRUE(),
_value <=300, "Less than or equal to 300",
_value <=500, "Less than or equal to 500",
_value <=700,"Less than or equal to 700")
2)Measure will be to get the uniqe sales reps:
unique sales reps = DISTINCTCOUNT('Commission data'[Name])
Then, I added these two in a table to get the desired output:
Hope this helps!
Thanks
AnthonyJoseph
@sarhutson you are looking for dynamic segmentation, check this blog post Dynamic segmentation – DAX Patterns
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@sarhutson you are looking for dynamic segmentation, check this blog post Dynamic segmentation – DAX Patterns
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @sarhutson
In my view, to achieve this we need to create a calculated column (grouped by name) and a measure.
I have mocked up the table name to be "Commission data" and sales rep to be "Name" and below are the codes.
1) Calculated column
grouped by name =
var _name = 'Commission data'[Name]
var _value = SUMX(FILTER('Commission data','Commission data'[Name] = _name),'Commission data'[Commission])
return
SWITCH(TRUE(),
_value <=300, "Less than or equal to 300",
_value <=500, "Less than or equal to 500",
_value <=700,"Less than or equal to 700")
2)Measure will be to get the uniqe sales reps:
unique sales reps = DISTINCTCOUNT('Commission data'[Name])
Then, I added these two in a table to get the desired output:
Hope this helps!
Thanks
AnthonyJoseph
Thank you @AnthonyJoseph ! This is very helpful!! Is there anyway to calculate the groupings in a measure so they will flex off of the date and plan columns so its dynamic? For example if I select the remote plan all 5 associate would then fall under "Less than or equal to $300"?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |