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 / Switch in powerfx in D...
Power Apps
Unanswered

Switch in powerfx in Dataverse

(0) ShareShare
ReportReport
Posted on by 2

I am trying to write a switch function in power fx in Dataverse that will calculate interest due by state where each state has a different interest rate. Currently I have:

Switch('State', "PA", (('Orig Judgment Amount' * 0.06) * 'DaysJudgment') / 365, "NY", (('Orig Judgment Amount' * 0.09) * 'DaysJudgment') / 365, "NJ", (('Orig Judgment Amount' * 2.25) * 'DaysJudgment') / 365)

But I am receiving the error ""The function 'Switch' has some invalid arguments." with no further explanation. Any ideas on how to make this work?

I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @tcbigg 

    I have tried to replicate the same as below

    Switch('Address 1: State/Province',"NSW",(('Original Judgment Amount' * 0.06) * DaysInJudgment) / 365,'Original Judgment Amount')

    The only difference as that I have added the last parameter as the default.

     

    Assumptions:

    -State is single line of text

    - Original Judgement amount is currency

    - Days in Judgement is number

     

     

     

  • tcbigg Profile Picture
    2 on at

    That seems to be more of a "If , Then, Else" function and not a Switch function. I need a different result by each state according to the calculation of interest by each state's interest rate. A mere default value after the initial calculation is exactly the opposite of a Switch function..

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard