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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PMnooBI
Frequent Visitor

Measure Totals are Wrong with IF condition measure

billed.PNG

 

 

 

 

 

 

 

 

 

Proposal LC is  the Budget and is a column 

Labor Spent is a measure which is ( Hours * hourly rate)

Contractors is a column but no values here 

Total Spent LC is a measure of (Labor Spent + Contractors)

Remaining Labor is a measure( Proposal LC - Total Spent LC)

Billed LC is a measure 

Billed LC = IF(CALCULATE(SUM(TaskBaselines[TaskBaselineCost])) > [Total Spent LC], [Total Spent LC], CALCULATE(SUM(TaskBaselines[TaskBaselineCost])))
taskbaselinecost is Proposal LC
Billed LC should be 9000 less but I think the dax is applying the measure to totals as well.
I want the totals to add every value in the Billed LC column 
 
HOW DO I RESOLVE THIS? 
 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @PMnooBI 
Please try

Billed LC =
SUMX (
    VALUES ( TaskBaselines[Phase.1] ),
    VAR TaskBaselineCost =
        CALCULATE ( SUM ( TaskBaselines[TaskBaselineCost] ) )
    VAR TotalSpentLC = [Total Spent LC]
    RETURN
        IF ( TaskBaselineCost > TotalSpentLC, TotalSpentLC, CTaskBaselineCost )
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @PMnooBI 
Please try

Billed LC =
SUMX (
    VALUES ( TaskBaselines[Phase.1] ),
    VAR TaskBaselineCost =
        CALCULATE ( SUM ( TaskBaselines[TaskBaselineCost] ) )
    VAR TotalSpentLC = [Total Spent LC]
    RETURN
        IF ( TaskBaselineCost > TotalSpentLC, TotalSpentLC, CTaskBaselineCost )
)

It worked!

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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