cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

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

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
Power Apps

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!

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%

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

Thank you very Much. This has worked. 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,025)