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
jamesgbrooks
Frequent Visitor

Business Day of Year - Help

Hey All,

 

I am trying to create a column and/or measure (not sure which is better in this situation) that will count the business day of the year. Please see the image below. For each date row, I want an output value similar to the "day of year" column that only counts business day of year IF it is a business day. If it is not a business day, I want the "business day of year" value to be null. 

 

Please note that I created an "Is Business Day" function(?) that is apparently not a measure nor a column. It is depicted below.

 

1.JPG

 

 

 

Capture.JPG

 

 

2.JPG

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @jamesgbrooks,

 

You could try with this fomula below and modify it for your requirement.

 

WorkdayCount =
IF (
    NOT ( WEEKDAY ( 'Day'[Date] ) IN { 1, 7 } ),
    RANKX (
        FILTER ( 'Day', NOT ( WEEKDAY ( 'Day'[Date] ) IN { 1, 7 } ) ),
        'Day'[Column],
        ,
        ASC,
        DENSE
    )
)

Here is the result.

 

Capture.PNG

 

More details you could have a reference of the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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-piga-msft
Resident Rockstar
Resident Rockstar

Hi @jamesgbrooks,

 

You could try with this fomula below and modify it for your requirement.

 

WorkdayCount =
IF (
    NOT ( WEEKDAY ( 'Day'[Date] ) IN { 1, 7 } ),
    RANKX (
        FILTER ( 'Day', NOT ( WEEKDAY ( 'Day'[Date] ) IN { 1, 7 } ) ),
        'Day'[Column],
        ,
        ASC,
        DENSE
    )
)

Here is the result.

 

Capture.PNG

 

More details you could have a reference of the attachment.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thejeswar
Resident Rockstar
Resident Rockstar

@jamesgbrooks,

Although Calculated Column / Measure doesn't make a difference in this case, I would recommend having it as a calculated column.

and you can try using the below DAX for getting NULLS

 

IsBussinessDay = IF(AND(NOT(MAX(Dates[Days])="Sunday"),NOT(MAX(Dates[Days])="Saturday")),"True","")

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.