Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear Team,
Please help me solve for construct below query.
ID | Status | Start Date | End Date | No: of Days |
201 | Done | 10/03/2022 | 10/06/2022 | 3 |
205 | Approved | 10/04/2022 | 9(when end date is blank we need to consider Today()-Start Date.) | |
206 | Deployed | 10/04/2022 | 9(when end date is blank we need to consider Today()-Start Date.) | |
207 | Done | 09/26/2022 | 09/29/2022 | 3 |
Please guide me how to write DAX fuction for above query.
Advance Thanks,
Venkata.
Solved! Go to Solution.
Hi @VenkataRavi ,
Assum that there is one date dimension table in your model, you can create a calculated column as below to get the number of days between two dates. Please find the details in the attachment.
No.of Days =
VAR _enddate =
IF ( ISBLANK ( 'Table'[End Date] ), TODAY (), 'Table'[End Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Date' ),
DATESBETWEEN ( 'Date'[Date], 'Table'[Start Date], _enddate ),
FILTER ( 'Date', WEEKDAY ( 'Date'[Date], 2 ) < 6 )
)
In addition, you can refer the following blog to get it by DAX or Power Query method...
Calculate Workdays Between Two Dates In Power BI
Best Regards
Hi @VenkataRavi ,
Assum that there is one date dimension table in your model, you can create a calculated column as below to get the number of days between two dates. Please find the details in the attachment.
No.of Days =
VAR _enddate =
IF ( ISBLANK ( 'Table'[End Date] ), TODAY (), 'Table'[End Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Date' ),
DATESBETWEEN ( 'Date'[Date], 'Table'[Start Date], _enddate ),
FILTER ( 'Date', WEEKDAY ( 'Date'[Date], 2 ) < 6 )
)
In addition, you can refer the following blog to get it by DAX or Power Query method...
Calculate Workdays Between Two Dates In Power BI
Best Regards
Please read about the NETWORKDAYS() function.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |