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
Anonymous
Not applicable

Calculate Working days for each month(if it is Non Working day, then should should last records data

Hi,

 

I am trying to calculate the Working days remaining for each month,

 

I have created a column to calculate if each day is Working day or not, But my requirement is if it is weekend or a non working day then it should show the previous days remaining working days

I have created the Rank for Working Day in Month by using the following DAX

Rank For Working Day in Month =
// Calculates the Working Day Rank by YearMonth
VAR AllDates = Dates[Date]
VAR YearMon = Dates[YearMon]
RETURN
CALCULATE (
RANK.EQ ( AllDates, Dates[Date], DESC ),
FILTER ( ALL( Dates ), AND(Dates[WorkingDay] = "Y", Dates[YearMon] = YearMon)
))

 

DateWorkingDayRank For Working Day in Month
Thursday, 1 August 2019Y21
Friday, 2 August 2019Y20
Saturday, 3 August 2019N 
Sunday, 4 August 2019N 
Monday, 5 August 2019Y19
Tuesday, 6 August 2019Y18
Wednesday, 7 August 2019Y17
Thursday, 8 August 2019Y16
Friday, 9 August 2019Y15
Saturday, 10 August 2019N 
Sunday, 11 August 2019N 
Monday, 12 August 2019Y14
Tuesday, 13 August 2019Y13
Wednesday, 14 August 2019Y12
Thursday, 15 August 2019Y11
Friday, 16 August 2019Y10
Saturday, 17 August 2019N 
Sunday, 18 August 2019N 
Monday, 19 August 2019Y9
Tuesday, 20 August 2019Y8
Wednesday, 21 August 2019Y7
Thursday, 22 August 2019Y6
Friday, 23 August 2019Y5
Saturday, 24 August 2019N 
Sunday, 25 August 2019N 
Monday, 26 August 2019N 
Tuesday, 27 August 2019Y4
Wednesday, 28 August 2019Y3
Thursday, 29 August 2019Y2
Friday, 30 August 2019Y1
Saturday, 31 August 2019N 

 

This is what I have achieved so for but, as you can see there are blanks for example on the 3rd and 4th I need to get 20.

 

Could anybody please help me in this regard.

 

Thanks,

Prime

1 REPLY 1
Anonymous
Not applicable

Can you please try 

WD =
RANKX (
FILTER ( WorkingDayCalculations, WorkingDayCalculations[WorkingDay] = "Y" ),
WorkingDayCalculations[Date].[Date]
)

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