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 / Where am I going wrong...
Power Apps
Answered

Where am I going wrong with the sum filter function?

(0) ShareShare
ReportReport
Posted on by 77

I have a dataverse table which one column as a choice column. I have a second column with points. I want to sum points where the choice column = 5D. 

 

Sum(
Filter(
Students,
Class = Class.Value.5D
),
Points
)

 

This formula isn't working. Where am I going wrong?

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @lmcc ,

     

    For a Local Choice, use:

     

     

    Sum(
     Filter(
     Students,
     Class = 'Class (Your Table Plural Name)'.SD
     ),
     Points
    )

     

     

    For a Global Choice, use:

     

     

    Sum(
     Filter(
     Students,
     Class = [@'Your Global Choice Name'].SD
     ),
     Points
    )

     

     

  • lmcc Profile Picture
    77 on at

    Hi,

     

    can you tell me what .SD means?

     

    as of yet it isn’t working. 

     

    Thank you,

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @lmcc - looks like my eyes are getting old - I read "S"D instead of "5"D. 

     

    "Isn't working" is not very descriptive.

  • lmcc Profile Picture
    77 on at

    I agree, I apologise for my bluntness. 

     

    The formula isn't working for some reason displaying this error. 

     

    Screenshot 2023-09-18 at 19.37.39.pngScreenshot 2023-09-18 at 19.37.30.png

    I may need to convert an argument so the match can occur. But this is causing me a headache. I can't figure it out at all. 

     

    Kind regards

     

     

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @lmcc - that is not the formula I proposed.

     

    Could you please confirm if your Choice field is a Local Choice or a Global Choice.

  • lmcc Profile Picture
    77 on at

    Hi There, 

     

    Thank you for responding. 

     

    The choice is global. 

     

    How might this change your formula?

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @lmcc - I already provided it above - you just need to use it instead of doing whatever it is your doing.

     

    Sum(
     Filter(
     'Your Table',
     Class = [@'Your Global Choice Name'].5D
     ),
     Points
    )

     

    If you're still struggling, please take a screenshot of your Global Choice field and the Lookup field in your Dataverse column which references the Global Choice field. Example below:

     

    Amik_0-1695112141232.png

     

    Amik_1-1695112206001.png

     

     

  • lmcc Profile Picture
    77 on at

    Hi, 

     

    Thank you for your perseverance. 

     

    Unfortunately, it didn't work with your suggestion. However, this did:

     

    AddColumns(
    GroupBy(
    AddColumns(
    Students,
    "yourNewStatus",
    Text('Academic House')
    ),
    "yourNewStatus",
    "Statuses"
    ),
    "Totals",
    CountRows(Statuses)
    )

     

    I'm wondering why?

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @lmcc - again - "it didn't work" is not descriptive. Is there an error for example?

     

    If you do indeed have a Dataverse Choice column in your Table, and that column is a Lookup to a Global Choice field, the solution provided will work.

     

    I suspect there is something going on with your Table and/or App which you have not clarified.

     

    I would not recommend using the AddColumns and GroupBy functions, they are not delegable and are completely unnecessary for this scenario.

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard