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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Tamking2
Regular Visitor

% of Target Help

I have been working on this for days, watched hours of videos, and still can't seem to get it right.

I am very new to Power BI but I assume this isn't as difficult as I am making it.

I have a historical Sales Table that shows what each employee did for Sales by Quarter in their first year and then annually. I want to measure their sales vs initial target and see how long it took them to reach their target. And then somehow show this as a visual by Company and then by Section. Ultimately I want the visual to show the trend toward how long it takes the average salesperson to reach their target and to ascertain if some sections reach it quicker than others.

I can't wrap my head around it and I'm hoping someone out there has had to do this before or can shed a little light on an approach.
Here is an example of the Data I have:

Table - Sales
Columns = Name, Year, Sales

Table - SalesPeople

Columns - Name, Department, Hire Date, Initial Target
I related Sales People to Total Sales by Name and created a Matrix Visual:

I used this formula to bring over the Target: 

Target =
VAR CurrentName = 'Sales'[Name]
Return
Maxx(Filter(All('SalesPeople'),SalesPeople[Name]=CurrentName), 'SalesPeople'[Initial Target])
 
NameDeptTarget1st Year2nd Tear3rd Year4th Year5th Year
DanielleCandy4250015374115293106162074 
JoeCandy500000408737543.3103256114455852023819
JohnOutDoor100000483281.9389982.3150234.4232967.8232969.8
SethGames10000016422664050423082622470775223416
AliciaGames100000234895835773.711737881037398546821
JeffGames15000064484.32112740.933221.5236755.969765.15
RobToys1000000400511.51203007704903.1267336.31755161
SueToys10000091788.05302651.781193.8284178.3341014
PaulToys500000108653532963.1878045.612811981863347
JaneToys10000067096.3830752.9321825.5427755.4849920.3
JoshuaToys180000986681.721044252179425213877.7404724
MelissaToys400000015353.542088543588567453.99

 

I think I should create a % column and use that as my value, but when I tried, it didn't exactly work...

% Target =
DIVIDE(Maxx('Sales','Sales'[Sales]),Maxx('Sales','Sales'[Target]), blank())
 
I may be completely off base, Any help would be appreciated
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Tamking2 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

% Target = 
VAR _selname =
    SELECTEDVALUE ( 'Sales'[Name] )
VAR _target =
    CALCULATE (
        MAX ( 'SalesPeople'[Initial Target] ),
        FILTER ( 'SalesPeople', 'SalesPeople'[Name] = _selname )
    )
VAR _selyear =
    SELECTEDVALUE ( 'Sales'[Year] )
VAR _sales =
    CALCULATE (
        SUM ( 'Sales'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Sales' ),
            'Sales'[Name] = _selname
                && 'Sales'[Year] <= _selyear
        )
    )
RETURN
    DIVIDE ( _sales, _target, BLANK () )

yingyinr_0-1658467776990.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Tamking2 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

% Target = 
VAR _selname =
    SELECTEDVALUE ( 'Sales'[Name] )
VAR _target =
    CALCULATE (
        MAX ( 'SalesPeople'[Initial Target] ),
        FILTER ( 'SalesPeople', 'SalesPeople'[Name] = _selname )
    )
VAR _selyear =
    SELECTEDVALUE ( 'Sales'[Year] )
VAR _sales =
    CALCULATE (
        SUM ( 'Sales'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Sales' ),
            'Sales'[Name] = _selname
                && 'Sales'[Year] <= _selyear
        )
    )
RETURN
    DIVIDE ( _sales, _target, BLANK () )

yingyinr_0-1658467776990.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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