cancel
Showing results 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.

Helper II

## Sum if Sales Rep Above Goal

Hi, I have a ordes table, a table for sales rep goal by quarter and a date table. I would like to group sales reps by percentage of revenue QTD above their goal in 5% increments. How would I write a measure to do this?

EDIT:

The end goal is something like the visualization below. Each of the colored lines represents the total value of for sales reps that land in a 5% increment bucket. For example, red would be sum of all sales reps who's total QTD revenue is between 0%-5% above the goal, orange bewteen 5% to 10%, etc.

4 REPLIES 4
Super User

Hi,

You can use MROUND to achieve this:

`if( Sales[Gross profit rate]>0, MROUND(Sales[Gross profit rate],0.05), MROUND(Sales[Gross profit rate],-0.05))),0)`

Thiss will round the measure (in mu example gross profit) to 5% increments. You can use your QTD measure as a base measure and then just compare this QTD measure to a QTD target measure (all within the MROUND)

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

Proud to be a Super User!

Helper II

Hi @ValtteriN thanks for the reply.  When I try to use your DAX there seems to be syntax error. Is there an additional IF statment needed?

Super User

@nbs33

Sorry about that, I used dax from another solution I had. Yes the example requires additional IF.

Here is modified DAX:

`if( Sales[Gross profit rate]>0, MROUND(Sales[Gross profit rate],0.05), MROUND(Sales[Gross profit rate],-0.05))`

Proud to be a Super User!

Super User

Measures like (common date table, common sales rep table )

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))

QTD Goal= CALCULATE(SUM(Sales[Goal]),DATESQTD(('Date'[Date])))

Achieve % = divide([QTD Sales] -[QTD Goal] ,[QTD Goal])

countx(filter(values(salesrep[salesrep]), [Achieve %] >.05) , [Salesrep] )

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors