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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cbouichi
Helper IV
Helper IV

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.Knipsel 3.PNG

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.

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@cbouichi,

 

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
        )
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@cbouichi,

 

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
        )
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thankx for the help.

 

Greetings from the Netherlands

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors