cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Post Prodigy
Post Prodigy

Can a build a column chart which show 2 columns for each user

I have the following sharepoint list:-

 

sxcores.png

 

as shown it show an engineer name and the number of green and red points each engineer got.

 

so i want to build  canvas inside power app which shows a column chart >> where the column chart should show 2 columns (Green & Red) for each engineer? is this possible.

 

Now i created a new canvas >> add a column chart >> define the following:-

 

chart.png

 

But it did not work, where i am unable to show 2 columns for each user + i am unable to find the Engineer field which is of type People or Group that allow single selection.

 

 

what i am looking for is something as follow:-

 

useeeeeeeeeeeeeeeeeeeeeee.png

Regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
HimanshuSSharma
Resolver I
Resolver I

@johnjohn123 Do you require Grouping?

 

You would require grouping if your data looks like this:

EngineerRed PointsGreen Points
John23
John42
Himanshu16
S35
S22
Sharma25
Sharma11
Sharma12

(repeating engineers)

You do not need to group if your data looks like this:

EngineerRed PointsGreen Points
John23
John 12342
Himanshu16
S35
Sharma25

 

If your data is like the second one, use AddColumns(Scores, "UserName", Engineer.FullName) 

 

If your data is like the second one, use AddColumns(GroupBy(Scores, "Engineer", "Data"), "UserName", Engineer.FullName, "Red Points", Sum(Data, ScoreRedPoint), "Green Points", Sum(Data, ScoreGreenPoint))

 

I am assuming Engineer.FullName is the name field in your organisation. I am assuming the case where your engineer columns is linked to people in your organisation.

 

In case Engineer is a simple string field, you do not need to use Engineer.FullName. Skip the part and you are good.

View solution in original post

5 REPLIES 5
rubin_boer
Super User
Super User

hi @johnjohn123 

 

add a chart control and add tis to its Items = AddColumns(GroupBy(YourData,"Engineer","User"),"Total Red",Sum(User,Red),"Total Green",Sum(User,Green))

 

St Number of series = 2

 

rubin_boer_0-1614338763191.png

 

This is what you will get.

Hope it helps

 

@rubin_boerthanks for the reply. i tried you approach but i got an error that GroupBy has some invalid arguments, as follow:-

 

for.png

 

Hint:- the Engineer field has an internal name =ScoreUser

 

I also tried this formula, but i got more errors on the GroupBy and on the Sum:-

 

errorororor.png

HimanshuSSharma
Resolver I
Resolver I

@johnjohn123 Why do you need to use Group by?

 

What you need to do is change the number of series to 2.

HimanshuSSharma_0-1614348837209.png

Go to Properties-> Number of series = 2

HimanshuSSharma_1-1614348880069.png

Also, change the colour of the series using ItemColorSet in the Advanced section:

HimanshuSSharma_2-1614349204341.png

 

I did Red, Green because of the table I used. You might want to do the reverse for your case.

 

If you want to use Group by for some reason, you might have to work with the formula a little, but you need to use it in case your Engineer column has repeated values.

 

Please accept the solution if it helps you!

@HimanshuSSharmai changed the number of series to 2 .. but which formula i need to use?

HimanshuSSharma
Resolver I
Resolver I

@johnjohn123 Do you require Grouping?

 

You would require grouping if your data looks like this:

EngineerRed PointsGreen Points
John23
John42
Himanshu16
S35
S22
Sharma25
Sharma11
Sharma12

(repeating engineers)

You do not need to group if your data looks like this:

EngineerRed PointsGreen Points
John23
John 12342
Himanshu16
S35
Sharma25

 

If your data is like the second one, use AddColumns(Scores, "UserName", Engineer.FullName) 

 

If your data is like the second one, use AddColumns(GroupBy(Scores, "Engineer", "Data"), "UserName", Engineer.FullName, "Red Points", Sum(Data, ScoreRedPoint), "Green Points", Sum(Data, ScoreGreenPoint))

 

I am assuming Engineer.FullName is the name field in your organisation. I am assuming the case where your engineer columns is linked to people in your organisation.

 

In case Engineer is a simple string field, you do not need to use Engineer.FullName. Skip the part and you are good.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (26,827)