Forum Discussion
Date diff Working Days to Today with filter
- Anonymous4 years ago
Hi ctedesco3307 ,
I suggest you to try this code to create a measure.
Measure = VAR _MINDATE = MIN(MAX('Table'[End Date]),TODAY()) VAR _COUNT = CALCULATE(SUM('Table'[Working Day]),FILTER('Table','Table'[MSSContractDay]<=_MINDATE))+0 RETURN _COUNTBest Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
A new column
networkdays([Start Date], Today(),1)
https://amitchandak.medium.com/power-bi-dax-function-networkdays-5c8e4aca38c
amitchandak thank you but the function needs to sum the workingday column in the table if workingday = 1 -- not just omit saturday and sunday - we have company holidays also
- amitchandak4 years ago
Super User
ctedesco3307 , Please refer blog I shared complete information on how to use the holiday calendar
https://amitchandak.medium.com/power-bi-dax-function-networkdays-5c8e4aca38c
- Anonymous4 years agoNot applicable
Hi ctedesco3307 ,
I suggest you to try this code to create a measure.
Measure = VAR _MINDATE = MIN(MAX('Table'[End Date]),TODAY()) VAR _COUNT = CALCULATE(SUM('Table'[Working Day]),FILTER('Table','Table'[MSSContractDay]<=_MINDATE))+0 RETURN _COUNTBest Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
hi Rico,
am using your DAX statement like this:
DaysDiff =VAR _MINDATE= MIN(MAX('KPI Delivery'[InvoiceDate]), TODAY())VAR _COUNT = CALCULATE(SUM('KPI Delivery'[InvoiceWeekendDay]),FILTER('KPI Delivery', 'KPI Delivery'[InvoiceDate]<=_MINDATE))+0RETURN_COUNTThe measure seems to be working but as soon as i add the measure to a visual i get this error message:
MdxScript(Model (5,29) Calculation error in measure TABLE [DaysDiff]; the function SUM cannot work with values of type string. Can you help. thnx!!- Anonymous2 years agoNot applicable
hi Rico,
forget about my question, found the issue and solved it.
The measure is working!
thnx!!!!