Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Multiple IF checks in Custom Column based on ID

Hey all, so I'm trying to create a custom column that will produce percentage rates depending on the total spend, but different service numbers have different rates. For example.

 

(if([RadarService] = 5) then if[TotalCost] < 5000 then .60 
else if[TotalCost] > 5000 then .56 else null

 

Then in the same custom column, I would want it to do the same check but for radarservice2 for example.

(if([RadarService] = 2) then if[TotalCost] < 5000 then .16
else if[TotalCost] > 5000 then .15 else null.

 

Any question let me know, I'm trying to wrap my head around PowerBi and it's queries 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for your reply,

 

I was pretty mentally drained yesterday so get how I was hard to understand.

 

I actually just got back into work and solved the issue! It's amazing what a good sleep can do. 🙂

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I'm struggling to understand what your question is?  Your code below looks pretty close to what you need to put in.  Have you tried using the "Add Column" option in the Edit Queries window and used code similar to what you have shown below?

 

Was there something specific that didn't work with your approriate?  Were you just unsure how to do nested ifs with Power Query?

 

If that last question was your actual question, then your assumption was correct based on the structure of the code you wrote.

Anonymous
Not applicable

Thanks for your reply,

 

I was pretty mentally drained yesterday so get how I was hard to understand.

 

I actually just got back into work and solved the issue! It's amazing what a good sleep can do. 🙂

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.