cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adavid
Regular Visitor

Powerapps if else currency percent

I have this as a text to a Label and it works with just text-

If(ThisItem.'Goal Table'=1,If("WDA"=Gallery2.Selected.Value,Sum(Filter(Goalscommon,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(Goalscommon,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(Goalscommon,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(Goalscommon,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=2,If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoals,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(SelectGoals,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoals,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(SelectGoals,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=3,If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoalPercent,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(SelectGoalPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoalPercent,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(SelectGoalPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=4,If("WDA"=Gallery2.Selected.Value,Sum(Filter(Specialmeasures,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(Specialmeasures,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(Specialmeasures,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(Specialmeasures,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=5,If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalCommonPercent,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(GoalCommonPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalCommonPercent,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(GoalCommonPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=6,If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalsDollar,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(GoalsDollar,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalsDollar,TabName=LabelTabName.Text),OctActualDEN)),Sum(Filter(GoalsDollar,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)))))))

 

Now I would like to format the results depending on what number the 'Goal Table' is.. like if it's 4 I want the results to show in %. If it's 6 I want it to show as currency. I've tried adding currency but it isn't working for me. The NUM is still showing results but not as currency and the DEN disappears altogether.

 

If(ThisItem.'Goal Table'=1,If("WDA"=Gallery2.Selected.Value,Sum(Filter(Goalscommon,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(Goalscommon,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(Goalscommon,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(Goalscommon,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=2,If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoals,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(SelectGoals,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoals,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(SelectGoals,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=3,If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoalPercent,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(SelectGoalPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(SelectGoalPercent,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(SelectGoalPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=4,If("WDA"=Gallery2.Selected.Value,Sum(Filter(Specialmeasures,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(Specialmeasures,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(Specialmeasures,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(Specialmeasures,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=5,If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalCommonPercent,TabName=LabelTabName.Text),OctActualNUM),Sum(Filter(GoalCommonPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualNUM))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalCommonPercent,TabName=LabelTabName.Text),OctActualDEN),Sum(Filter(GoalCommonPercent,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),OctActualDEN)),If(ThisItem.'Goal Table'=6,If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalsDollar,TabName=LabelTabName.Text),"$"&Text(OctActualNUM,"[$-en-US]0.00")),Sum(Filter(GoalsDollar,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),"$"&Text(OctActualNUM,"[$-en-US]0.00")))&" / "&If("WDA"=Gallery2.Selected.Value,Sum(Filter(GoalsDollar,TabName=LabelTabName.Text),"$"&Text(OctActualDEN,"[$-en-US]0.00"))),Sum(Filter(GoalsDollar,Office=Gallery2.Selected.Value && TabName=LabelTabName.Text),"$"&Text(OctActualDEN,"[$-en-US]0.00")))))))) 

 

Any suggestions?

 

0 REPLIES 0

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,603)