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
Community Champion
Community Champion

@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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,377)