Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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?

Categories:
  • tcbigg Profile Picture
    2 on at
    Re: Switch in powerfx in Dataverse

    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..

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Switch in powerfx in Dataverse

    @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

     

     

     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 13 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics