web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Column Chart 2 Column
Power Apps
Answered

Column Chart 2 Column

(0) ShareShare
ReportReport
Posted on by 372

Hello, 

 

I'm new in using column chart. So, I have this data:

firda59_0-1690945421717.png

I want to make chart like this:

firda59_1-1690945647862.png

 

But I dont know how to add formula in this chart, and now I'm using formula like this:
AddColumns(GroupBy(AddColumns('PERGERAKAN KOMPONEN',"abc",'Next Location'),"abc","abcCount"),"Total Komponen", CountRows(abcCount))

Can anyone help me? Thank you.

Categories:
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @firda59 ,

     

    We Made a sample for you.

    DataSource:

    vhanytianmsft_0-1690960314223.png

     

     

    Insert a Button for Collection the data:

    ClearCollect(Col1, AddColumns(GroupBy(AddColumns('0802-2',"abc",'Next Location'),"abc","abcCount"),"Total Komponen", CountRows(abcCount)),{Test:0});

    ClearCollect(Col2,AddColumns(GroupBy(AddColumns('0802-2',"abc",'Current Location'.Value),"abc","abcCount"),"Test", CountRows(abcCount)));

    ForAll(Col2 As C,If(C.abc in Col1.abc,Patch(Col1,LookUp(Col1,abc = C.abc),{Test:C.Test}),Patch(Col1,Defaults(Col1),{abc:C.abc,Test:C.Test})))

    vhanytianmsft_1-1690960314230.png

     

    Items:Col1

    vhanytianmsft_2-1690960314235.png

     

    NumberOfSeries:2

    vhanytianmsft_3-1690960314239.png

     

     

    Hope this will help you,

     

    Best Regards,

    Tina

  • firda59 Profile Picture
    372 on at

    Hi @v-hanytian-msft 

     

    Patch(Col1,LookUp(Col1,abc = C.abc),{Test:C.Test}),Patch(Col1,Defaults(Col1),{abc:C.abc,Test:C.Test})))

    may I know what the meaning of C.abc? Cause I got error message,

    firda59_0-1690965661560.png

     

  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @firda59 ,

    C.abc mens it can get the field of Col2,

     

    Operators and Identifiers in Power Apps - Power Platform | Microsoft Learn

    vhanytianmsft_0-1690965864045.png

     

    May I ask what are the formula you wrote of the OnSelect?

    We can fix it together.

     

    Hope this will help you,

    Best Regards,
    Tina

  • firda59 Profile Picture
    372 on at

    Hi @v-hanytian-msft 

     

    ClearCollect(Col1, AddColumns(GroupBy(AddColumns('PERGERAKAN KOMPONEN',"abc",'Next Location'),"abc","abcCount"),"Next Loc.", CountRows(abcCount)),{Test:0});

    ClearCollect(Col2,AddColumns(GroupBy(AddColumns('PERGERAKAN KOMPONEN',"abc",'Current Location'),"abc","abcCount"),"Current Loc.", CountRows(abcCount)));

    ForAll(Col2 As C,If(C.abc in Col1.abc, Patch(Col1,LookUp(Col1,abc = C.abc),{Test:C.Test}),Patch(Col1,Defaults(Col1),{abc:C.abc,Test:C.Test})))

     

    This is my formula, and the error:

    firda59_0-1690966888610.png

    I also got this error: The function 'Patch' has some invalid arguments.

  • Verified answer
    v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @firda59 ,

    Thank you for such detailed information.

     

    Please try this:

    ClearCollect(Col1, AddColumns(GroupBy(AddColumns('PERGERAKAN KOMPONEN',"abc",'Next Location'),"abc","abcCount"),"Next Loc.", CountRows(abcCount)),{'Current Loc.':0});
    
    ClearCollect(Col2,AddColumns(GroupBy(AddColumns('PERGERAKAN KOMPONEN',"abc",'Current Location'.Value),"abc","abcCount"),"Current Loc.", CountRows(abcCount)));
    
    ForAll(Col2 As C,If(C.abc in Col1.abc, Patch(Col1,LookUp(Col1,abc = C.abc),{'Current Loc.':C.'Current Loc.'}),Patch(Col1,Defaults(Col1),{abc:C.abc,'Current Loc.':C.'Current Loc.'})))
    
     

    vhanytianmsft_0-1690968805138.png

    Hope this will help you,
    Best Regards,
    Tina

  • firda59 Profile Picture
    372 on at

    Hi @v-hanytian-msft 

     

    Thankyou so much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard