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

Community site session details

Session Id : ARxdJPpWv/OlaXQ8V2pBj9
Power Apps - Building Power Apps
Answered

How to get the number onto text label.

Like (0) ShareShare
ReportReport
Posted on 25 Mar 2021 14:34:00 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 

I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,291 Super User 2024 Season 1 on 25 Mar 2021 at 14:46:10
    Re: How to get the number onto text label.

    @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 25 Mar 2021 at 16:19:13
    Re: How to get the number onto text label.

    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,291 Super User 2024 Season 1 on 25 Mar 2021 at 17:08:45
    Re: How to get the number onto text label.

    @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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete