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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
BYENER
Helper V
Helper V

Use another calculation for values before a specific date

Hi All,

 

I hope someone can help me. I am using a measure to sum hours and divide by 8 and multiply by 7.5, but I don't want to do the last step (/8 * 7.5) for hours after 1st of January 2024. How can I fix this in my measure? The measure below is not working.

 

Thanks a lot!

 

Bruto Hours X =

VAR StartDate = DATE ( 2001, 01, 01 )
VAR EndDate =   DATE ( 2023, 12, 31 )
VAR previousCalculation = IFERROR(SUM(Hours[X]),"") /8*7.5
VAR newCalculation = IFERROR(SUM(Hours[X]),"")

return

IF(DATESBETWEEN(Hours[Datum],StartDate,EndDate),previousCalculation,newCalculation)
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@BYENER 

Try this measure:

Bruto Hours X =
SUMX (
    Hours,
    IF (
        Hours[Datum] < DATE ( 2024, 01, 01 ),
        DIVIDE ( Hours[X], 8 ) * 7.5,
        Hours[X]
    )
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
BYENER
Helper V
Helper V

@Fowmy  thanks a lot! It's working.

Fowmy
Super User
Super User

@BYENER 

Try this measure:

Bruto Hours X =
SUMX (
    Hours,
    IF (
        Hours[Datum] < DATE ( 2024, 01, 01 ),
        DIVIDE ( Hours[X], 8 ) * 7.5,
        Hours[X]
    )
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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