- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Networkdays function is adding an extra day
I'm trying to add a measure to calculate the number of working days between two dates, but the measure I've built adds an extra day. 0 days shows as 1 working days, 1 day as 2 working days and so on. The data is in Direct Query and I have no access to Power Query unfortunately.
Here's the DAX for the measures (days and working days):
DEFINE
MEASURE 'Stage2'[form response days] = CALCULATE(
DATEDIFF(
MAX('Stage2'[Form Received Date]),
MAX(KPI_DATA[Stage 2 Start Date]),
DAY
),
USERELATIONSHIP(
'Calendar'[Date],
'KPI_DATA'[Stage 2 Start Date]
)
)
MEASURE 'Stage2'[form response working days]=
CALCULATE(
NETWORKDAYS(MAX('Stage2'[Form Received Date]),MAX('KPI_DATA'[Stage 2 Start Date])),
USERELATIONSHIP('Calendar'[Date],'KPI_DATA'[Stage 2 Start Date])
)
EVALUATE
SUMMARIZECOLUMNS(
'Stage2'[id],
'Stage2'[Form Received Date],
KPI_DATA[Stage 2 Start Date],
"form response days", 'Stage2'[CF response days],
"form response working days", 'Stage2'[CF response working days]
)
And here's the relevant section of the model, in case that helps:
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stumbled upon this yesterday, too. The documentation says "Returns the number of whole workdays between two dates (inclusive)." So "inclusive" means including the start date. My solutution was to simply subtract one day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stumbled upon this yesterday, too. The documentation says "Returns the number of whole workdays between two dates (inclusive)." So "inclusive" means including the start date. My solutution was to simply subtract one day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, I did try that but it didn't seem to work with my model. (And didn't seem to fix the issue either).
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - January 2025
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
Subject | Author | Posted | |
---|---|---|---|
08-23-2024 07:09 AM | |||
09-16-2024 12:41 AM | |||
07-16-2024 02:46 AM | |||
08-28-2024 12:22 AM | |||
03-05-2024 04:05 AM |
User | Count |
---|---|
13 | |
13 | |
12 | |
8 | |
7 |
User | Count |
---|---|
18 | |
14 | |
11 | |
11 | |
9 |