cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AdamE
Level: Powered On

Sum function result blank when a record contains a decimal

Hi Everyone,

 

I've created a basic canvas app using a CDS table (MJABillingActivities). I have a label on my browse screen with the following formula in it's text property:

 

Text(Sum(Filter(MJABillingActivities,Year=Value(ddYear.Selected.Value)&&Month=Value(ddMonth.Selected.Value)),'Service Hours'),"[$-en-US]#.#")

 

The intent of the formula is to return a total for all the Service Hours in the table once filtered by the values of two drop down boxes ddMonth and ddYear.  There is a Month column and a Year column in the table. The formula displays the correct amount as long as the values in the Service Hours column of the table ONLY contain whole numbers. Once I add or change a value in the Service Hours column to have a decimal value the result of the formula is blank.  Some additional info: the Month and Year columns are defined as Whole Number columns and the Service Hours column is defined as a Decimal Number column in CDS.

 

Any help or ideas would be greatly appreciated.

Adam

 

 

7 REPLIES 7
v-siky-msft
Level 8

Re: Sum function result blank when a record contains a decimal

Hi @AdamE ,

 

The issue is confirmed on my side, I would post this issue to my product team. If this issue is solved, I would reply here.

For the time being, you can use FirstN and CountRows function to solve this issue as below, but the delegation needs attention.

Text(
    Sum(
        FirstN(
            Filter(
                MJABillingActivities,
                Year = Value(ddYear.Selected.Value) && Month = Value(ddMonth.Selected.Value)
            ),
            CountRows(
                Filter(
                    MJABillingActivities,
                    Year = Value(ddYear.Selected.Value) && Month = Value(ddMonth.Selected.Value)
                )
            )
        ),
        'Service Hours'
    ),
    "[$-en-US]#.#"
)

Best Regards,

Sik

Super User
Super User

Re: Sum function result blank when a record contains a decimal

Hi @AdamE 

 

I carried out a test on my side and I am not able to replicate this. Can you try to delete the data source connection and add it again. 
 
Hope this helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
AdamE
Level: Powered On

Re: Sum function result blank when a record contains a decimal

Thank you Sik. I appreciate your response. 

AdamE
Level: Powered On

Re: Sum function result blank when a record contains a decimal

Thank you for your response yashag2255. I tried your suggestion of removing the data source and adding it back. Unfortunately it didn't change anything. Interesting you can't replicate it.

 

The following formula works properly on the same table when I remove the filtering portion. But unfortunately I have to have the filtering.

 

Text(Sum(MJABillingActivities,'Service Hours'),"[$-en-US]#.#")
 
Thanks again.
Adam
 
 
 
Super User
Super User

Re: Sum function result blank when a record contains a decimal

Hey @AdamE 

 

Can you carry out a test on your side, create a temporary button and on the "OnSelect" property, paste the formula:
ClearCollect(TestCollection,Filter(MJABillingActivities,Year=Value(ddYear.Selected.Value)&&Month=Value(ddMonth.Selected.Value)))
 
This should return all the rows which satisfies the specified year and month into the "TestCollection" collection.
 
I tried to replicate the scenario shared by you, please have a look at the attached screenshots and this is returning the sum from the CDS entity.
MicrosoftTeams-image (2).png

 

MicrosoftTeams-image (1).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
AdamE
Level: Powered On

Re: Sum function result blank when a record contains a decimal

Hey yashag2255,

 

Upon seeing your post this morning I decided to create another app to do some more testing. The formula in the new app while using my original CDS table IS working properly. Unfortunately, I don't know why it is working properly because my original app using the same table and formula still doesn't work. That would leave me to believe something in my orginal app is wonky. Another thing I don't understand is I tried this same test a week ago and it didn't work. I'm not sure what I could have done to the application to make it not work as in all my app creations were generated for me using the "Start from Data" option. 

 

Anyway, thank you for your help through this. I appreciate it.

 

Adam Ellis

 

Super User
Super User

Re: Sum function result blank when a record contains a decimal

Hey @AdamE 

 

Sometimes due to caching issues, few things don't work as expected. This usually gets resolved by re-login into the application after clearing the cache. If you still want to give this a try in your existing application, I would recommend you to close the browser and login again. If this doesn't help, remove the control itself and create it again. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 171 members 5,269 guests
Recent signins:
Please welcome our newest community members: