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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
AllanBerces
Post Prodigy
Post Prodigy

Multiple IF Condition

Hi and good day to all,

Can someone help me on my new calculated column. I have a table with column scope, % materials, Budgeted hrs, Treade and Hour Equevalent. Basically what i want to achieved is 

  • if the Trade is equal to Scaff, then the Hour Equevalent is equal to Budgeted hrs
  • if the the Materials Column is Blank then the Hour Equevalent is equal to Budgeted hrs
  • if the Materials Column has value then the Hour Equevalent is equal to (Materials x Budgeted Hours) except for the Scaff Trade

Table:

AllanBerces_0-1737796973291.png

Desired Output

AllanBerces_1-1737797058277.png

Thank you

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @AllanBerces  - You can create the calculated column for "Hour Equivalent" in Power BI using DAX.

Hour Equivalent =
IF(
    Heoutput[Trade] = "Scaff",
    Heoutput[Budgeted hrs],
    IF(
        Heoutput[% Materials] = BLANK() || Heoutput[% Materials] = "Blank",
        Heoutput[Budgeted hrs],
        Heoutput[% Materials] * Heoutput[Budgeted hrs]
    )
)

 

rajendraongole1_0-1737801074602.png

 

Please check and i hope it works at your end.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
AllanBerces
Post Prodigy
Post Prodigy

Hi @rajendraongole1 @divyed @DataNinja777 thank you very much for the reply, I tried all your solution and it's perfectly. 

divyed
Super User
Super User

Hello @AllanBerces ,

 

You can try below dax :

 

Hour_Equivalent =
IF(
    'table1'[Trade] = "Scaff",
    'table1'[Budgeted_hrs],
    IF(
        ISBLANK('table1'[Per_Material]),
        'table1'[Budgeted_hrs],
        'table1'[Per_Material] * 'table1'[Budgeted_hrs]
    )
)

 

divyed_0-1737803873270.png

 

Please modify table and field names or let us know in case you want differenyt result.

 

Cheers

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
DataNinja777
Super User
Super User

Hi @AllanBerces ,

 

Your requirement can be easily handled with a calculated column in Power BI using the DAX formula below similar to the Excel example you produced:

Hour Equivalent =
SWITCH(
    TRUE(),
    'YourTable'[Trade] = "Scaff", 'YourTable'[Budgeted hrs],
    ISBLANK('YourTable'[% Materials]), 'YourTable'[Budgeted hrs],
    'YourTable'[% Materials] * 'YourTable'[Budgeted hrs]
)

 

Best regards,

rajendraongole1
Super User
Super User

Hi @AllanBerces  - You can create the calculated column for "Hour Equivalent" in Power BI using DAX.

Hour Equivalent =
IF(
    Heoutput[Trade] = "Scaff",
    Heoutput[Budgeted hrs],
    IF(
        Heoutput[% Materials] = BLANK() || Heoutput[% Materials] = "Blank",
        Heoutput[Budgeted hrs],
        Heoutput[% Materials] * Heoutput[Budgeted hrs]
    )
)

 

rajendraongole1_0-1737801074602.png

 

Please check and i hope it works at your end.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors