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

Bar chart by category with total

Hi all,

 

Here a preview of my data:

SaaM_0-1632473400348.png

 

and I would like to have something like this:

SaaM_1-1632473439149.png

How I proceed to get this:

 

I created one graph with the data athlete and the distance runned by athlete (left graph)

I created another graph with the data athlete and the max of distance goal (right graph)

and then I put one on top of the other to get the result

SaaM_2-1632473486840.png

 

Is there a better way to get this ?

 

Thanks in advance

 

Kind regards

Saam

 

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Create a measure along the lines of:

Distance to goal = [Goal]-[Distance Run]

Then create the stacked chart with the [Distance run] and [Distance to goal] measures. Turn on the "Labels" & "Total label" in  the formatting pane, and if you want to sort the visual by Goal, add the goal measure to the Tooltips. And you get this:

result.JPG

 

 I've attached the sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

Create a measure along the lines of:

Distance to goal = [Goal]-[Distance Run]

Then create the stacked chart with the [Distance run] and [Distance to goal] measures. Turn on the "Labels" & "Total label" in  the formatting pane, and if you want to sort the visual by Goal, add the goal measure to the Tooltips. And you get this:

result.JPG

 

 I've attached the sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






vaishnaviudan
Resolver I
Resolver I

Hi,

You can add "Stacked Column Chart" Visual to get result.

Refer screenshot given below for detailed information.

StackedColumnChart.PNG

I tried your solution but it is not okay for me.

 

Actually i am looking to show for example for the athlete a that he runned 500kms of 500 kms

and athlete g runned 130 kms of 410 kms (his goal) like represented in my first post.

 

With your visual, i have for each athlete the total runned and on top the goal distance.

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.