Forum Discussion
norken20
Helper I
6 years agoCreating 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 (t...
- 6 years ago
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.
- Anonymous6 years ago
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.
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.
rajulshah
Resident Rockstar
6 years agoHello 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.
norken20
Helper I
6 years agoThank you man. Your formula is very helpful and was able to modify it to display what I wanted. Thank you so much 🙂