Forum Discussion
FILIPKACZMAR
Advocate I
4 years agoCounting days
Hello everyone!!! I am new at Power BI community (learning) and I have got a little problem. At my new work I got the task to repair our PowerBI dashboard. I have to count days between tw...
- 4 years ago
Hi FILIPKACZMAR
Please use the following= VAR First = 'SQA list'[End of Inspection].[Date] VAR Last = 'SQA list'[Delivered Report].[Date] VAR First1 = IF ( First <= Last, First, Last - 1 ) VAR Last1 = IF ( First <= Last, Last, First1 ) RETURN COUNTROWS ( FILTER ( ADDCOLUMNS ( CALENDAR ( First1, Last1 ), "Day of Week", WEEKDAY ( [Date], 2 ) ), [Day of Week] <> 6 && [Day of Week] <> 7 ) )
Whitewater100
Solution Sage
4 years agoHi:
You can use DATESBETWEEN function:
For example:
DatesBtwn = DATESBETWEEN(Calendar[Date], [End of Inspection], [Delivered Report])
I will attach a report that shows a few examples of using either DATESBETWEEN or DATESINPERIOD. You should create a Date Table (MODELING>NEW TABLE>
and mak as Date Table and connect to Fact Table. This will allow you to do time intel calculations.
Date Table Code:
Dates = ADDCOLUMNS ( CALENDAR (FIRSTDATE(Sheet1[ Date]), TODAY()), "year", YEAR ( [Date] ), "MonthNumber", FORMAT ( [Date], "MM" ), "year-month", FORMAT ( [Date], "YYYY-MM" ), "month-year", FORMAT ( [Date], "MM-'YY" ) )