Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
There are two columns, Void Start and Due Date, I would like to work out the number of working days between the two days.
I've tried to use the following formula shown here (by @Greg_Deckler ), but I can't seem to get it to work.
This is the code for my situation (created it as a measure):
NetWorkDays =
VAR Calendar1 = CALENDAR(MAX('Voids Data'[Void Start]),MAX('Voids Data'[Due Date (corrected)]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])
It's accepted by PowerBI, but when I throw it into a table visualisation (this visualisation has two columns, one is void start date, the other is due date), I get the following error:
Please help.
Solved! Go to Solution.
So I kept playing around with different solutions but the original solution provided by @Greg_Deckler seemed to work once I removed null values from my data and then made the extreme values zero:
VAR Calendar1 = CALENDAR(MIN('Voids Data'[Start]),MIN('Voids Data'[End]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN IF(COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])>1000,0,COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date]))
So I kept playing around with different solutions but the original solution provided by @Greg_Deckler seemed to work once I removed null values from my data and then made the extreme values zero:
VAR Calendar1 = CALENDAR(MIN('Voids Data'[Start]),MIN('Voids Data'[End]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN IF(COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])>1000,0,COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date]))
Hi raeesgillani,
Could you please tell us if your problem has been solved? If you have any problem, please feel free to tell me.
Best Regards,
Teige
Yes the issue was resolved, thank you for the check 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |