cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Willo
Helper II
Helper II

Counting rows and showing "N/A' when If is false

Hello everyone,
I'm counting rows in a collection based on the data showing in a label of a gallery and columns in the collection. This is what I'm using today and it works. The only issue is that this will show 0% if there are none as well as if the count comes back as 0%. Wondering if there is away to have it show "N/A" is the count comes back as NULL.
 
Text(CountIf(SiteRTWData,RTWCompleted.Value="Yes",Manager=Title10_10.Text)/ ((CountIf(
        SiteRTWData,RTWCompleted.Value="No",Manager=Title10_10.Text)+CountIf(
        SiteRTWData,RTWCompleted.Value="Yes",Manager=Title10_10.Text))),"[$-en-US]#,#0.0000")*100 & "%"

1 REPLY 1
rsaikrishna
Dual Super User
Dual Super User

@Willo 

 

You can place below entire formula in the label's Text property as below:

 

UpdateContext( { varFormulaValue:  Text(CountIf(SiteRTWData,RTWCompleted.Value="Yes",Manager=Title10_10.Text)/ ((CountIf(
        SiteRTWData,RTWCompleted.Value="No",Manager=Title10_10.Text)+CountIf(
        SiteRTWData,RTWCompleted.Value="Yes",Manager=Title10_10.Text))),"[$-en-US]#,#0.0000")*100 & "%" } )

 

if( varFormulaValue = "0%", "N/A",varFormulaValue)

 

Give a try and let me know if you run into any issues.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (90,644)