Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
I am attempting to create a measure per row which counts the working days between two days within the same table. To do that, I found the following guide:
https://blog.enterprisedna.co/calculate-workdays-between-two-dates-in-power-bi/
However, when I follow it, I get the error message "A single value for column 'DateOfDelivery' in table 'Deliveries' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.". Unfortunately, I am unsure how to address this problem adequately. The way I see it, there is always just one 'DateOfDelivery' per row so I do not understand how this single value cannot be determined per row.
Here is the table that I am using:
Here, it is possible that one order may result in several deliveries.
And this is my date table:
I am using the following DAX expression:
PassedDays1 =
CALCULATE(
COUNTROWS('Date'),
DATESBETWEEN(
'Date'[Date],
Deliveries[DateOfDelivery],
Deliveries[OrderDate]
),
'Date'[IsWeekday] = TRUE
)
Does anyone know what/where my error is?
Solved! Go to Solution.
You're adding it as a measure, not a calculated column, therefore it doesn't have a row context and doesn't know which delivery date or order date to use.
If you use the same code as a calculated column it will work, but since that blog article was published there is now a NETWORKDAYS function in DAX, so you could just use that instead.
Working days column = NETWORKDAYS(Deliveries[Order date], Deliveries[Delivery date])
You're adding it as a measure, not a calculated column, therefore it doesn't have a row context and doesn't know which delivery date or order date to use.
If you use the same code as a calculated column it will work, but since that blog article was published there is now a NETWORKDAYS function in DAX, so you could just use that instead.
Working days column = NETWORKDAYS(Deliveries[Order date], Deliveries[Delivery date])
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |