cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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
Highlighted
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!

Highlighted

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%
Highlighted

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

Highlighted

Thank you very Much. This has worked. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,076)