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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
sbott
Helper I
Helper I

Calculation column

I have a spreadsheet where I use the formula =IF(S2="Lead Functional",R2*118,IF(S2="Lead Technical",R2*118,IF(S2="Analyst",R2*67.5,IF(S2="Technical",R2*112.5,IF(S2="Functional",R2*112.5,0)))))

 

It looks at what is in S2, then depending on the content it multiples R2 by a specific value. What is is doing is looking to see what the role type is (S2), then multiplying the hourly rate by the number of hours (R2). 

 

I want to create a column (assume custom column?) but not sure how to do it.  The columns I would use are Role, Hours and then I want a column called Sales Price with the multiplication. 

 

Can anyone advise please?

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi

Custom column formula = 

= [Hours] * 
Record.FieldOrDefault(
[Lead Functional = 118, Lead Technical = 118, Analyst = 67.5, Technical = 112.5, Functional = 112.5],
[Role],
0)

Stéphane 

View solution in original post

5 REPLIES 5
slorin
Super User
Super User

Hi

Custom column formula = 

= [Hours] * 
Record.FieldOrDefault(
[Lead Functional = 118, Lead Technical = 118, Analyst = 67.5, Technical = 112.5, Functional = 112.5],
[Role],
0)

Stéphane 

Many thanks, that works a treat.

Thanks,  but I just adapted AlienSx's solution

Stéphane 

AlienSx
Super User
Super User

rec = 
 [Lead Functional = 118,
 Lead Technical = 118,
 Analyst = 67.5,
 Technical = 112.5,
 Functional = 112.5],
price = Table.AddColumn(your_table, "Sales Price", each [Hours] * Record.FieldOrDefault(rec, [Role], 0))

Many thanks for taking time to reply, you can probably tell I am a newbie to Power Query. Where would I go from here?

 

sbott_0-1689256376303.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.