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
Syndicate_Admin
Administrator
Administrator

Create column, applying filters.

Dear! I need to make a column for overtime settlements, identifying when it is appropriate to pay them at %50 or %100.

I have the table 'jornales' with the field [Hs_Extras], I want to generate a colunma for when [Hs_Extras] > 0 only when on Monday, Tuesday, Wednesday, Thursday, Friday and Saturday the value is 50, and when [Hs_Extras] > 0 on Sunday the value is 100.

I tried creating a column from an IF but it didn't work for me. HELP!!

This is the code that applies, Liq_Hs = IF([Hs_Extras] >0 & [Days] = "Sunday", "100", "50")

1 ACCEPTED SOLUTION

@Syndicate_Admin Create a column like this:-

Liq_Hs_Extras =
IF (
    [HS_extras] > TIME ( 00, 00, 00 )
        && WEEKDAY ( [Fecha], 1 ) = 1
        || WEEKDAY ([Fecha], 1 ) = 7,
    100,
    50
)

Output:-

Samarth_18_0-1647030978915.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Dear! Thank you

I leave the example tables:

Fr4ncoFerr3r_0-1647028844321.png

Fr4ncoFerr3r_1-1647028923977.png

I need to generate a column = [Liq_Hs_Extras] that when [Hs_Extras] > 0, the value is 50 if the calendar marks Monday Tuesday Wednesday, Thursday or Friday, and when [Hs_Extras] > 0 on Saturdays and Sundays the value is 100. To obetener the following data

Fr4ncoFerr3r_2-1647029089572.png

Apply a Liq_Hs_Extras = IF([Hs_Extras]>0, "50", "100") but throw all the values at 50.

@Syndicate_Admin Create a column like this:-

Liq_Hs_Extras =
IF (
    [HS_extras] > TIME ( 00, 00, 00 )
        && WEEKDAY ( [Fecha], 1 ) = 1
        || WEEKDAY ([Fecha], 1 ) = 7,
    100,
    50
)

Output:-

Samarth_18_0-1647030978915.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Thank you for the collaboration. I have served myself and managed to move forward. Thank you.

Samarth_18
Community Champion
Community Champion

Hi @Syndicate_Admin ,

 

What is the error you are getting with below code and could you please help us with sample data in text format with expected output?

Liq_Hs = IF([Hs_Extras] >0 && [Days] = "Sunday", "100", "50")


Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.