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

Gallery Calculation in label

Hi ,

 

I could not do the Label 4 Calculation. Can you help me.

 

Gallery Powerapps.png

4 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@dursunzeeee 

Sorry, extra curly bracket in my last message:

Change to:

With({_items: Filter(Menu_Grup; Custom_Grup = Dropdown17_5.Selected.Result)};

    AddColumns(_items;
        "_sum"; Sum(_items; yourQtyColumnName)
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

RandyHayes
Super User III
Super User III

@dursunzeeee 

Sorry, I notice an issue with the last Items property I gave.  Should be this:

With({_data: Filter(Menu_Grup; Custom_Grup = Dropdown17_5.Selected.Result)};
    With({_innerData:
        AddColumns(_data;
            "_sum"; Sum(_data; Satis_Miktari);
            "_pop"; Average(_data; Satis_Miktari);
            "_cost"; Maliyet / Satis_Fiyati
        )
        };
        AddColumns(_innerData;
            "_costAvg"; Average(_innerData; _cost)
        )        
    )
)

We needed to actually do the last Average around the inner table.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

I learned the function for Switch instead of If

Switch(Text(If(ThisItem.SALES*1 >= ThisItem._pop*1; "H"; "L")&If(ThisItem._cost >= ThisItem._costAvg; "L"; "H"));"HH";"STAR";"HL";"WORKHORSE";"LH";"CHALLENGE";"LL";"DOG")

 

View solution in original post

31 REPLIES 31
RandyHayes
Super User III
Super User III

@dursunzeeee 

Items property of your Gallery:

With({_items: yourCurrentItemsProperty}},

    AddColumns(_items,
        "_sum", Sum(_items, Label_3ColumnName)
    )
)

Label_4 Text:

Text((ThisItem.Label3ColumnName / ThisItem._sum) * 100, "#%")

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Drrickryp
Super User II
Super User II

@dursunzeeee 

For a more detailed explanation of how to set up a gallery in PowerApps see below.  It has a calculation for a sum of the $ amounts in the gallery.!.jpg

I cant "qty/allqty"

dursunzeeee_0-1615138371702.png

 

RandyHayes
Super User III
Super User III

@dursunzeeee 

What is your Items property for the Gallery?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

dursunzeeee_0-1615138892355.png

 

RandyHayes
Super User III
Super User III

@dursunzeeee 

I am not understanding...you're not using the Items property that I suggested you should implement.

Your formula should be:

 

With({_items: Filter(Menu_Grup; Custom_Grup = Dropdown17_5.Selected.Result)}};

    AddColumns(_items;
        "_sum"; Sum(_items; yourQtyColumnName)
    )
)

 

Replace yourQtyColumnName in the above with the name of the column in your datasource that you want to have the sum of.

 

For your Percentage column - this formula on the Text property:

Text((ThisItem.yourQtyColumnName/ ThisItem._sum) * 100; "#%")

And again, replace the column name in the above. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
dursunzeeee
Helper II
Helper II

dursunzeeee_1-1615142060626.png

 

When gallery3_4 items write your code 

 

RandyHayes
Super User III
Super User III

@dursunzeeee 

Sorry, extra curly bracket in my last message:

Change to:

With({_items: Filter(Menu_Grup; Custom_Grup = Dropdown17_5.Selected.Result)};

    AddColumns(_items;
        "_sum"; Sum(_items; yourQtyColumnName)
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

dursunzeeee
Helper II
Helper II

Thank you very much for your support. I just started learning Powerapss.

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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (51,277)