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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
electrobrit
Post Patron
Post Patron

Multiple conditions

I am trying to get a table where I have standard working hours, Total PTO, Adjusted Hours (Std hours-PTO), then a final column where if the resource type is "Contractor" or a specific person, ex. "Andy", it equals Hours Worked.
Otherwise, it's the Adjusted Hours

I have done most measures in a Key measures table. Then I have a detail table where I'm trying to do the conditional column (Contractor or Andy=hours worked, else Adjusted Hours) with the measures and detail. 
I've tried

Column 2 = SWITCH(
    TRUE(),
    'TimeDetail'[full_name]="Andy"|| TimeDetail[ResourceType]="Contractor", SUMX('--Key Measures',[TotalHoursWorked]),
 [AdjustedHours]
)

I've tried this and get same results

Column 2 = SWITCH(
    TRUE(),
    TimeDetail[ResourceType]= "Contractor", [TotalHoursWorked],
    TimeDetail[full_name]= "Andy", [TotalHoursWorked],
    TimeDetail[ResourceType]= "Employee", [AdjustedHours])

I've looked at the data and it's not the data, but some of the column values (conditonal column) are off.
In the screenshot, they should equal the total hours worked columnn 
Is there another way to do this conditional column or can anyone tell what might be wrong?

electrobrit_0-1664566975469.png

 


1 ACCEPTED SOLUTION
Dinesh_Suranga
Continued Contributor
Continued Contributor

@electrobrit 

Hi

Try this.

Column 2 =IF(SELECTEDVALUE(TimeDetail[full_name])= "Andy", [TotalHoursWorked],
IF(SELECTEDVALUE(TimeDetail[ResourceType]) = "Contractor", [TotalHoursWorked],[AdjustedHours]))

Thnak you.

 

View solution in original post

2 REPLIES 2
Dinesh_Suranga
Continued Contributor
Continued Contributor

@electrobrit 

Hi

Try this.

Column 2 =IF(SELECTEDVALUE(TimeDetail[full_name])= "Andy", [TotalHoursWorked],
IF(SELECTEDVALUE(TimeDetail[ResourceType]) = "Contractor", [TotalHoursWorked],[AdjustedHours]))

Thnak you.

 

added as a measure in the key measures table and worked perfectly. THANK YOU

Helpful resources

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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