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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
norken20
Helper I
Helper I

Creating Graph that shows attainment on a target

Hi All,

 

I just want to seek help on what is the best way to do this in power BI.

 

I have two tables as shown below. What I want is to create a stacked bar chart that will reflect the target (table 1) and the attainment if each personnel (posted status only). Your help will be very much appreciated. Thanks.

 

 
PersonnelTarget Sales 
A500
B400
C300
D200
E100
 
PersonnelStatusSales Value
APosted20
BPosted40
CNot Posted60
DPosted20
EPosted50
EPosted60
DNot Posted10
DPosted40
ANot Posted20
BNot Posted12
BNot Posted10
3 ACCEPTED SOLUTIONS
rajulshah
Resident Rockstar
Resident Rockstar

Hello @norken20,

 

Do you want something like this?
salestarget.png

 

View solution in original post

Hello @norken20,

You can create a measure as below:

Target yet to achieve = 
VAR SalesValue = CALCULATE(SUM(Sales[Sales Value]),Sales[Status]="Posted")
VAR Target = SUM(TargetSales[Target Sales ])
VAR TargetToAchieve = Target - SalesValue
RETURN IF(TargetToAchieve<0,0,TargetToAchieve)

And use Sales and This measure in a stacked chart.

 

Let me know if this didn't help.

View solution in original post

Anonymous
Not applicable

Hi @norken20 ,

 

Please create two measures as below and add then to visual.

current attainment = CALCULATE(SUM('Table (2)'[Sales Value]),FILTER('Table (2)','Table (2)'[Status]="Posted"))

sales target = 
VAR target = SELECTEDVALUE('Table'[Target Sales ])-[current attainment]
return
IF(target<0,0,target)

Result would be shown as below.

1.PNG

 Pbix as attached.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @norken20 ,

 

Please create two measures as below and add then to visual.

current attainment = CALCULATE(SUM('Table (2)'[Sales Value]),FILTER('Table (2)','Table (2)'[Status]="Posted"))

sales target = 
VAR target = SELECTEDVALUE('Table'[Target Sales ])-[current attainment]
return
IF(target<0,0,target)

Result would be shown as below.

1.PNG

 Pbix as attached.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is workable too. Thank ypou so much!!!!

rajulshah
Resident Rockstar
Resident Rockstar

Hello @norken20,

 

Do you want something like this?
salestarget.png

 

Thanks man. The idea is what I'm expecting 🙂 But do you think it's possible to have the sample graph below? Where the blue shade is the total sales target while the black is the current attainment which are the posted only. Not posted in the table will not be included. Thanks

 

Expected GraphExpected Graph

Hello @norken20,

You can create a measure as below:

Target yet to achieve = 
VAR SalesValue = CALCULATE(SUM(Sales[Sales Value]),Sales[Status]="Posted")
VAR Target = SUM(TargetSales[Target Sales ])
VAR TargetToAchieve = Target - SalesValue
RETURN IF(TargetToAchieve<0,0,TargetToAchieve)

And use Sales and This measure in a stacked chart.

 

Let me know if this didn't help.

Thank you man. Your formula is very helpful and was able to modify it to display what I wanted. Thank you so much 🙂

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors