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

Announcements

News and Announcements icon
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,415 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard