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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
EDWNW
Frequent Visitor

Sales By People Not Trained Based on Slicer Selections

I am trying to determine if the various trainings my organization has been offering have been effective or not. To that end I have two tables:

 

1. Order Details - this contains the employee IDs and their sales by deal, such as this:

Sales IDEmployee IDSales Amount
123455520
456755530
891012115
654812140
134698730

 

2. Trainings - this shows which employees have taken which training

Training NameEmployee ID
Sell More555
Sell More121
Making Money555
Building Networks121

 

There is an inactive relationship between 'Order Details'[Employee ID] and 'Trainings'[Employee ID]. 'Trainings' filters 'Order Details'. This relationship is inactive because there is another table filtering both the 'Order Details' and 'Trainings' which is active, but let's ignore that for now to keep things as simple as possible.
I also have a slicer, 'Training'[Training Name], so people using this report can select the training(s) they are interested in. They may only select one training, or they may select multiple trainings.

One way to show if the trainings have been effective is by looking at the average deal size by people who have taken a training and those who have not, to that end I have put together these measures:

 

Average Deal Size = AVERAGEX(DISTINCT('Order Details'[Sales ID]),[Total Revenue])

Trained Sales Rep Avg Deal Size = CALCULATE([Average Deal Size],USERELATIONSHIP('Order Details'[Employee ID],'Trainings'[Employee ID]))

Not Trained Rep Avg Deal Size = CALCULTATE([Average Deal Size],????????

 

Can anyone help with the Not Trained Rep Avg Deal Size? What filters should I apply here?

 

One idea I had was use LOOKUPVALUE=BLANK() such as:

 

Not Trained Rep Avg Deal Size =

var SelectedClass = VALUES('Trainigs'[Training Name])

return
CALCULATE([Average Deal Size], FILTER('Order Details', LOOKUPVALUE(Trainings[Employee ID],Trainings[Employee ID],'Order Details'[Employee ID],Trainings[Training Name],SelectedClass)=BLANK()))

This of course results in an error, that multiple values were supplied when one was expected. 

To put what I want into words: for an employee in the 'Order Details' table, have they taken one of the courses selected in the slicer? If they haven't then include their sales in the average.

 

Some example outcomes:

 

For "Sell More"

Trained Sales Rep Avg Deal Size = 26.25

Not Trained Rep Avg Deal Size = 30.00

 

For "Making Money"

Trained Sales Rep Avg Deal Size = 25.00

Not Trained Rep Avg Deal Size = 28.33

 

For "Sell More" AND "Building Networks"

Trained Sales Rep Avg Deal Size = 26.25

Not Trained Rep Avg Deal Size = 30.00

 

Thanks for any help or guidance you can provide.

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Not sure if this is exactly what you are looking for but here in an approach that works with no relationship between your Sales and Training tables.  Make a table with your Training Course names and these two measures:

 

Trained =
CALCULATE (
SUM ( Sales[Sales Amount] ),
TREATAS ( VALUES ( Training[Employee ID] ), Sales[Employee ID] )
)

 

Not Trained =
CALCULATE (
SUM ( Sales[Sales Amount] ),
EXCEPT (
VALUES ( Sales[Employee ID] ),
TREATAS ( VALUES ( Training[Employee ID] ), Sales[Employee ID] )
)
)

 

To be able to get total sales for those trained and not trained that looks like this:

NotTrained.png

This will work with one or more training courses selected.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Employee
Employee

Not sure if this is exactly what you are looking for but here in an approach that works with no relationship between your Sales and Training tables.  Make a table with your Training Course names and these two measures:

 

Trained =
CALCULATE (
SUM ( Sales[Sales Amount] ),
TREATAS ( VALUES ( Training[Employee ID] ), Sales[Employee ID] )
)

 

Not Trained =
CALCULATE (
SUM ( Sales[Sales Amount] ),
EXCEPT (
VALUES ( Sales[Employee ID] ),
TREATAS ( VALUES ( Training[Employee ID] ), Sales[Employee ID] )
)
)

 

To be able to get total sales for those trained and not trained that looks like this:

NotTrained.png

This will work with one or more training courses selected.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


This is great, works like a charm.

 

Thank you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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