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
jayanthan
Helper III
Helper III

Retrieve Last 3 working days in each month

Hi All

 

How can retrieve last 3 working days in each month , please advice

 

Thanks in Advance

 

Regards

Jayanthan

1 ACCEPTED SOLUTION

@jayanthan

 

I am guessing you want to add a column which returns True for the last 3 working days in a month so you can slice by them in your report. You can do it by adding first this column:

 

WorkDay = WEEKDAY( [Date], 2 ) < 6

and then this one:

 

LastThreeDaysInMonth = 
CONTAINS(
    CALCULATETABLE(
        TOPN( 3, 'Calendar', [Date], DESC ),
        ALLEXCEPT( 'Calendar', 'Calendar'[Month], 'Calendar'[Year] ),
        'Calendar'[WorkDay] = TRUE
    ),
    'Calendar'[Date],
    'Calendar'[Date]
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

4 REPLIES 4
LivioLanzo
Solution Sage
Solution Sage

Hi @jayanthan

 

do you have the date table already set up?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hi @LivioLanzo

 

Yes , i have , please find the calendar pbix in below given link

 

https://www.dropbox.com/s/pxxc5523qv6b5hj/Calendar_File.pbix?dl=0

 

Regards

Jayanthan

@jayanthan

 

I am guessing you want to add a column which returns True for the last 3 working days in a month so you can slice by them in your report. You can do it by adding first this column:

 

WorkDay = WEEKDAY( [Date], 2 ) < 6

and then this one:

 

LastThreeDaysInMonth = 
CONTAINS(
    CALCULATETABLE(
        TOPN( 3, 'Calendar', [Date], DESC ),
        ALLEXCEPT( 'Calendar', 'Calendar'[Month], 'Calendar'[Year] ),
        'Calendar'[WorkDay] = TRUE
    ),
    'Calendar'[Date],
    'Calendar'[Date]
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hi LivioLanzo

 

Wow,It works, thank you so much for the support

 

Regards

Jayanthan

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.