Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Need help with my formula

Hello everybody.

 

Need help with my formula im still learning the DAX languages.

What i want is that we look in column "Deelopdracht gereed Ja/nee. if is Ja than check the day differents between Column "Bonnen verstuurd op" With "Deelopdracht klaar op" must be smaller or equal to 7. then oke and give results in days

 

If Column "Deelopdracht gereed ja/nee" is Nee check day differents between Column "Bonnen verstuurd op" With Column "Geplande einddatum project". must be smaller or equal to 7. then oke.

 

 

This is what i came up with.

Bonnen verstuurd binnen (dagen) = IF([Deelopdracht klaar op].[Day]>[Bonnen verstuurd op]; DATEDIFF([Bonnen verstuurd op];[Geplande einddatum project];DAY); DATEDIFF([Geplande einddatum project]; [Bonnen verstuurd op];DAY); IF([Deelopdracht gereed ja/nee]"nee",Projectstatus[Deelopdracht klaar op].[Day]Datediff([Geplande einddatum Project])

 

I hope its clear for everybody.

 

  • Anonymous,

     

    You may refer to the following DAX that adds a calculated column.

    Column =
    SWITCH (
        Table1[Deelopdracht gereed ja/nee],
        "Ja", IF (
            Table1[Deelopdracht klaar op] <= Table1[Bonnen verstuurd op],
            DATEDIFF ( Table1[Deelopdracht klaar op], Table1[Bonnen verstuurd op], DAY ),
            - DATEDIFF ( Table1[Bonnen verstuurd op], Table1[Deelopdracht klaar op], DAY )
        ),
        "Nee", IF (
            Table1[Geplande einddatum project] <= Table1[Bonnen verstuurd op],
            DATEDIFF (
                Table1[Geplande einddatum project],
                Table1[Bonnen verstuurd op],
                DAY
            ),
            - DATEDIFF (
                Table1[Bonnen verstuurd op],
                Table1[Geplande einddatum project],
                DAY
            )
        )
    )
    

2 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous,

     

    You may refer to the following DAX that adds a calculated column.

    Column =
    SWITCH (
        Table1[Deelopdracht gereed ja/nee],
        "Ja", IF (
            Table1[Deelopdracht klaar op] <= Table1[Bonnen verstuurd op],
            DATEDIFF ( Table1[Deelopdracht klaar op], Table1[Bonnen verstuurd op], DAY ),
            - DATEDIFF ( Table1[Bonnen verstuurd op], Table1[Deelopdracht klaar op], DAY )
        ),
        "Nee", IF (
            Table1[Geplande einddatum project] <= Table1[Bonnen verstuurd op],
            DATEDIFF (
                Table1[Geplande einddatum project],
                Table1[Bonnen verstuurd op],
                DAY
            ),
            - DATEDIFF (
                Table1[Bonnen verstuurd op],
                Table1[Geplande einddatum project],
                DAY
            )
        )
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thankx for the help.

       

      Greetings from the Netherlands