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
kostask
Helper II
Helper II

Calculating Achived Targets for different levels

Hi guys.

I came up with a problem that has to do with sales targets and rate of achievement. So we have 2 business units (A and B). Every BU has its salesmen (x,y,z). Every salesman has monthly targets for sales. At the end of the month, we can calculate the achieved targets, meaning sales over target per month per salesman

1.PNG

So we can see that we achieved 3 of 6 targets, which gives a 50% success rate.

I want to create a calculated measure to calculate the success rate per BU per month (ignoring the salesmen). As we can see for 2022-7, business unit A had a target of 25E (10+15) and sold 24E (9+15), which gives a success rate of 0%. For 2022-8 with a total target of 38E sold 38E which gives 100% and so on. Is it possible to calculate the above?

Thank you in advance for your time!

Kostas

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1664221038190.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1664221038190.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

philouduv
Resolver III
Resolver III

Hey @kostask ,

I created a calculated column doing what you want :

BU sucess =
Var actual = CALCULATE(Sum(Table5[Actual Sales]),Filter(Table5,
Table5[Business Unit] == EARLIER(Table5[Business Unit])
&&
Table5[Month].[Month] == EARLIER(Table5[Month].[Month])))

var expected = CALCULATE(Sum(Table5[Sales Target]),Filter(Table5,
Table5[Business Unit] == EARLIER(Table5[Business Unit])
&&
Table5[Month].[Month] == EARLIER(Table5[Month].[Month])))

Return (IF(actual >= expected,100,0))

Basically you have 2 variables summing expected and actual sales by month and business unit.

You can change the return if you want the accurante percentage by doing the calcul in the IF Condition.

Best regards,

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.

Top Solution Authors