web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to get the number ...
Power Apps
Unanswered

How to get the number onto text label.

(0) ShareShare
ReportReport
Posted on by 18

Hi Power apps community,

 

i have a reach out number that i calcule and im not able to take that number and make a (if) with him since it a Text Label. Or it may be something wrong i do. please help me 🙂

 

So this is how i calcule my number using CountRows 

Text = Round(CountRows(Filter(Gallery4.AllItems;Title6.Text="Office_1";Subtitle4.Text=Text(Today())))/33*100;3)&Text("%")

Krazyesko_0-1616682455026.png

that the result 

my gallery is set : nameoftheoffice and date = so Title6.txt = officename and Subtitle4.Text=Date and im counting how many have the same filter and set a "%".

 

but i want to make that change color for exemple : If number <= 30% change color RGBA(255; 255; 255; 1) or RED notification.

 

Thanks you 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Krazyesko 

    Set your color property to:

       If(Value(Self.Text) <=.3, White, Red)

     

    I hope this is helpful for you.

  • Krazyesko Profile Picture
    18 on at

    Thanks for the fast reply - it work thanks !!

     

    Color=If(Value(Self.Text) <=.3, White, Red)

    on my region :  If(Value(Self.Text) <=.3; White; Red)

     

    For other people - the Self.Text is a reference of the Label (who gonna change color and target the result)

     

    target Label4_7

    color = other label that would like the color change.

    Color = If(Value(Label4_7.Text)>=30;White;Red)

     

    Krazyesko_0-1616689145929.png

     

     

    thanks

     

     

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Krazyesko 

    No variables needed - it would be completely redundant. 

     

    First, let's fix your Text property.  It should be :

    Text(Round((CountRows(Filter(Gallery4.AllItems; Title6.Text="Office_1"; Subtitle4.Text=Text(Today()) )) /33) * 100; 3) & "%"

     

    The Self.Text refers to the Text property of the control you are on (the label in this case).  It will be whatever the Text is in your label.  It is not relevant what the formula is on the Text property that builds the text...it is just the resultant text.

     

    Value turns that Text into a Number.

    NOW...I cannot see your pictures well enough to know if you have 12.121% or 12,121%  OR, in other words, what is your locale?  Seeing now the semicolons in the formula you have, I can tell that you are not using US based locale.

     

    So, if that is the case, then the comma in the text is going to cause a problem and we have to then tell the Value property what locale you are in.  Based on some of the text in your images, I am assuming French.

    So...change your formula to this:

        If(Value(Self.Text, "fr-FR") <=.3, White, Red)

    This will tell the Value function what locale format to use in converting.

     

     

    EDIT: Sorry, formula should be this:      If(Value(Self.Text; "fr-FR") <=.3; White; Red) forgot to change commas to semicolons for you.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard