Help converting VBA into Power Query

pmbassan

New Member
Joined
Nov 28, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey guys!
I use this VBA since 2018, but now I want to use it in Power BI. Can someone please help me converting this from VBA to DAX, so I can use it?
The VBA calculate the period between the two dates, only considering working hours (8h30-18h30), working days, discarding weekends and holidays (holidays in Brazil are in the second page, named "Feriados").

The example is in this file: Calculadora nova_V3_Correção_Jan_2018.xlsm
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
That code is very long and doesn't seem to do anything. It would be better if you used XL2BB and copied Before and After samples (NOT screenshots!).
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top