cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Rebeccak
Level: Powered On

Multiple data on LineChart

Can I achieve this in powerapps?  I am unsure how to do it. 

 MgrSupervisorInternal
Q195%45%85%
Q290%50%90%
Q355%45%87%
Q460%85%45%

sample line chart.png

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Multiple data on LineChart

How do you get your data? If you are defining it (i.e., in Excel, SharePoint, or directly), you can format it as in your original table, or using an expression like the one below:

ClearCollect(
    MyData,
    { Quarter: "Q1", Manager: 95%, Supervisor: 45%, Internal: 85% },
    { Quarter: "Q2", Manager: 90%, Supervisor: 50%, Internal: 90% },
    { Quarter: "Q3", Manager: 55%, Supervisor: 45%, Internal: 87% },
    { Quarter: "Q4", Manager: 60%, Supervisor: 85%, Internal: 45% })

If you already have the data in the format from your last post, you will need to "pivot" the table, to move some of the rows into columns. For this case, you can use this expression below:

RenameColumns(
    AddColumns(
        Distinct(MyData2, Quarter),
        "Supervisor", LookUp(MyData2, Type = "Supervisor" And Quarter = Result, Total),
        "Manager", LookUp(MyData2, Type = "Manager" And Quarter = Result, Total),
        "Internal", LookUp(MyData2, Type = "Internal" And Quarter = Result, Total)),
    "Result", "Quarter")

I've attached another version of the same app to this answer (ForumThread335008b.msapp), feel free to open it to see how you can implement this scenario.

View solution in original post

4 REPLIES 4
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Multiple data on LineChart

You can set the NumberOfSeries property on the line chart to be able to have multiple series on the same chart. To create the chart below:

ForumPost001.png

I updated the following properties on the control:

 

NumberOfSeries: 3
Items: MyData // the name of the collection in my example
  Labels: Quarter      // you can see these on the Advanced tab
  Series1: Mgr         // in the right-side pane after selecting
  Series2: Supervisor  // the line chart control
  Series3: Internal
ItemColorSet: [RGBA(49, 30, 193, 1),RGBA(248,166,103, 1), RGBA(94,93,108,1)]

 

The attached file shows this scenario. To open it, save it locally, then go to https://create.powerapps.com, choose Open, Browse and select the file that you previously saved.

Hope this helps!

Rebeccak
Level: Powered On

Re: Multiple data on LineChart

That makes complete sense, but i am unsure on how to get my data collection to look like yours. When i collect the data it looks like this: Any Suggestions?

TypeQuarterTotal
SupervisorQ145%
SupervisorQ250%
SupervisorQ345%
SupervisorQ485%
ManagerQ195%
ManagerQ290%
ManagerQ355%
ManagerQ460%
InternalQ185%
InternalQ290%
InternalQ387%
InternalQ445%
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Multiple data on LineChart

How do you get your data? If you are defining it (i.e., in Excel, SharePoint, or directly), you can format it as in your original table, or using an expression like the one below:

ClearCollect(
    MyData,
    { Quarter: "Q1", Manager: 95%, Supervisor: 45%, Internal: 85% },
    { Quarter: "Q2", Manager: 90%, Supervisor: 50%, Internal: 90% },
    { Quarter: "Q3", Manager: 55%, Supervisor: 45%, Internal: 87% },
    { Quarter: "Q4", Manager: 60%, Supervisor: 85%, Internal: 45% })

If you already have the data in the format from your last post, you will need to "pivot" the table, to move some of the rows into columns. For this case, you can use this expression below:

RenameColumns(
    AddColumns(
        Distinct(MyData2, Quarter),
        "Supervisor", LookUp(MyData2, Type = "Supervisor" And Quarter = Result, Total),
        "Manager", LookUp(MyData2, Type = "Manager" And Quarter = Result, Total),
        "Internal", LookUp(MyData2, Type = "Internal" And Quarter = Result, Total)),
    "Result", "Quarter")

I've attached another version of the same app to this answer (ForumThread335008b.msapp), feel free to open it to see how you can implement this scenario.

View solution in original post

Rebeccak
Level: Powered On

Re: Multiple data on LineChart

Thank you very Much. This has worked. 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,629)