Forum Discussion
NETWORKDAYS type function in PowerBI
- Anonymous9 years ago
Hi kyleldi,
Firstly, create a calendar table in Power BI Desktop following the guide in this blog. Then create a column in the calendar table using the Dax below.is work day = SWITCH(WEEKDAY([Date]),1,0,7,0,1)
Secondly, create a measure using the following DAX and create a card visual.
Days= CALCULATE(SUM('Date'[is work day]), DATESBETWEEN('Date'[Date], [OldestDate], [NewestDate] ))Thanks,
Lydia Zhang
Hi kyleldi,
Firstly, create a calendar table in Power BI Desktop following the guide in this blog. Then create a column in the calendar table using the Dax below.
is work day = SWITCH(WEEKDAY([Date]),1,0,7,0,1)
Secondly, create a measure using the following DAX and create a card visual.
Days= CALCULATE(SUM('Date'[is work day]),
DATESBETWEEN('Date'[Date],
[OldestDate],
[NewestDate]
))
Thanks,
Lydia Zhang
Hi,
When I try to create the measure (last step of your instructions) i get an error message: "A single value for column 'Total Revenue' in table 'SalesData' 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."
Ho wdo i resolve that? Also are we meant to create a relationship with the Date/Calendar Table and the table containing our start and end dates?