Forum Discussion

BYENER's avatar
BYENER
Helper V
2 years ago
Solved

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)
  • BYENER 

    Try this measure:

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



2 Replies

  • BYENER 

    Try this measure:

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