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 / Identifying distinct v...
Power Apps
Answered

Identifying distinct values and calculating total value in CDS

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Everyone,

 

I have a marketing table in CDS which contains following information

 

RegionCountryValue
North AmericaUS100
North AmericaUS

50

North AmericaCanada

20

North AmericaCanada

70

EMEA UK

80

EMEAEurope

40

 

I need to showcase these values in PowerApps by summarizing the values, like for North America region first identify how many countries are present in that region and display total value for each country.

 

for e.g. US country total value = 150, for Canada = 90 and so on. Separate gallery needs to be created for each region, like one for NA, one for EMEA, etc.

 

Can someone help in calculation logic?

 

Thanks!

Categories:
  • timl Profile Picture
    37,422 Super User 2026 Season 2 on at

    Hi @Anonymous 

    A good place to start would be to use the GroupBy/Sum functions. There's an example of this in the following documentation page.

    https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-groupby

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @timl Tried a lot of ways and this kind of gets me a list of countries but unable to get sum of values. Can you please help?

     

    ClearCollect(accountGroupMkt,AddColumns(GroupBy(accountMkt,"cr5fd_CountryName","Group Country"),"Sum Region",Sum("cr5fd_Regionname",Value("cr5fd_Value"))));

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Bumping up this thread. In case anyone can help, please post. Thanks.

  • Verified answer
    timl Profile Picture
    37,422 Super User 2026 Season 2 on at

    Hi @Anonymous 

    I think logically, this is more correct and should take you further. If not, I'm sure we'll get there with a few more refinements.

    If your cr5fd_Value field is numeric, you won't need to wrap it around a call to the Value function.

     ClearCollect(accountGroupMkt,
     AddColumns(GroupBy(accountMkt,"cr5fd_CountryName", "cr5fd_Regionname", "GroupByRegion"),
     "SumOfRegion", 
     Sum(GroupByRegion, cr5fd_Value)
     )
     )

     

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard