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
ajohn1
Advocate I
Advocate I

Total Number of Business Days.

I've created columns 1 & 2 with Power BI. I need help creating column 3. Just to be clear, the date go until 12/31/9999.

 

Thanks in advance.

 

DateTypeNumber of Business Days
Friday, January 01, 2016H19
Saturday, January 02, 2016W19
Sunday, January 03, 2016W19
Monday, January 04, 2016B19
Tuesday, January 05, 2016B19
Wednesday, January 06, 2016B19
Thursday, January 07, 2016B19
Friday, January 08, 2016B19
Saturday, January 09, 2016W19
Sunday, January 10, 2016W19
Monday, January 11, 2016B19
Tuesday, January 12, 2016B19
Wednesday, January 13, 2016B19
Thursday, January 14, 2016B19
Friday, January 15, 2016B19
Saturday, January 16, 2016W19
Sunday, January 17, 2016W19
Monday, January 18, 2016H19
Tuesday, January 19, 2016B19
Wednesday, January 20, 2016B19
Thursday, January 21, 2016B19
Friday, January 22, 2016B19
Saturday, January 23, 2016W19
Sunday, January 24, 2016W19
Monday, January 25, 2016B19
Tuesday, January 26, 2016B19
Wednesday, January 27, 2016B19
Thursday, January 28, 2016B19
Friday, January 29, 2016B19
Saturday, January 30, 2016W19
Sunday, January 31, 2016W19
Monday, February 01, 2016B21
Tuesday, February 02, 2016B21
Wednesday, February 03, 2016B21
Thursday, February 04, 2016B21
Friday, February 05, 2016B21
Saturday, February 06, 2016W21
Sunday, February 07, 2016W21
Monday, February 08, 2016B21
Tuesday, February 09, 2016B21
Wednesday, February 10, 2016B21
Thursday, February 11, 2016B21
Friday, February 12, 2016B21
Saturday, February 13, 2016H21
Sunday, February 14, 2016W21
Monday, February 15, 2016B21
Tuesday, February 16, 2016B21
Wednesday, February 17, 2016B21
Thursday, February 18, 2016B21
Friday, February 19, 2016B21
Saturday, February 20, 2016W21
Sunday, February 21, 2016W21
Monday, February 22, 2016B21
Tuesday, February 23, 2016B21
Wednesday, February 24, 2016B21
Thursday, February 25, 2016B21
Friday, February 26, 2016B21
Saturday, February 27, 2016W21
Sunday, February 28, 2016W21
Monday, February 29, 2016B21
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @ajohn1

    After my research, you can do these as below:

Step1:

add a year month column by this formula

 

Year Month Number = YEAR ( 'Table1'[Date] ) * 100 + MONTH ( Table1[Date] )

Step2:

 

Use EARLIER Function to get the result column

 

Result = CALCULATE(COUNT(Table1[Type]),FILTER(Table1,Table1[Type]="B"&&Table1[Year Month Number]=EARLIER(Table1[Year Month Number])))

Result:

 

3.PNG

here is pbix, please try it

https://www.dropbox.com/s/ml477sxw7btitr1/Total%20Number%20of%20Business%20Days.pbix?dl=0

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @ajohn1

    After my research, you can do these as below:

Step1:

add a year month column by this formula

 

Year Month Number = YEAR ( 'Table1'[Date] ) * 100 + MONTH ( Table1[Date] )

Step2:

 

Use EARLIER Function to get the result column

 

Result = CALCULATE(COUNT(Table1[Type]),FILTER(Table1,Table1[Type]="B"&&Table1[Year Month Number]=EARLIER(Table1[Year Month Number])))

Result:

 

3.PNG

here is pbix, please try it

https://www.dropbox.com/s/ml477sxw7btitr1/Total%20Number%20of%20Business%20Days.pbix?dl=0

 

 

Best Regards,

Lin

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

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.