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 All ,
Thank You
Lior
Solved! Go to Solution.
Hi @Lior0707 ,
According to your description, @Greg_Deckler gave a good solution on dates in two columns.
You mentioned that your dates are in same column. In this case, there are different solutions based on different data.
1. If the column only have two date rows.
First add an index column in Power Query, then create a measure.
Date diff =
VAR Calendar1 =
CALENDAR (
MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Index] = 1 ), 'Table'[Date] ),
MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Index] = 2 ), 'Table'[Date] )
)
VAR Calendar2 =
ADDCOLUMNS ( Calendar1, "WeekDay", WEEKDAY ( [Date], 2 ) )
RETURN
COUNTX ( FILTER ( Calendar2, [WeekDay] < 6 ), [Date] )
Get the result.
2. If there are multiple rows of dates in the column, and you want to compare the difference between every two rows of dates.
First add an index column in Power Query, then create a measure.
Date diff2 =
VAR Calendar1 =
CALENDAR (
MAX ( 'Table'[Date] ),
IF (
MAX ( 'Table'[Index] ) <> MAXX ( ALL ( 'Table' ), 'Table'[Index] ),
MAXX (
FILTER ( ALL ( 'Table' ), 'Table'[Index] = MAX ( 'Table'[Index] ) + 1 ),
'Table'[Date]
),
MAX ( 'Table'[Date] )
)
)
VAR Calendar2 =
ADDCOLUMNS ( Calendar1, "WeekDay", WEEKDAY ( [Date], 2 ) )
RETURN
COUNTX ( FILTER ( Calendar2, [WeekDay] < 6 ), [Date] )
Get the result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Lior0707 ,
According to your description, @Greg_Deckler gave a good solution on dates in two columns.
You mentioned that your dates are in same column. In this case, there are different solutions based on different data.
1. If the column only have two date rows.
First add an index column in Power Query, then create a measure.
Date diff =
VAR Calendar1 =
CALENDAR (
MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Index] = 1 ), 'Table'[Date] ),
MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Index] = 2 ), 'Table'[Date] )
)
VAR Calendar2 =
ADDCOLUMNS ( Calendar1, "WeekDay", WEEKDAY ( [Date], 2 ) )
RETURN
COUNTX ( FILTER ( Calendar2, [WeekDay] < 6 ), [Date] )
Get the result.
2. If there are multiple rows of dates in the column, and you want to compare the difference between every two rows of dates.
First add an index column in Power Query, then create a measure.
Date diff2 =
VAR Calendar1 =
CALENDAR (
MAX ( 'Table'[Date] ),
IF (
MAX ( 'Table'[Index] ) <> MAXX ( ALL ( 'Table' ), 'Table'[Index] ),
MAXX (
FILTER ( ALL ( 'Table' ), 'Table'[Index] = MAX ( 'Table'[Index] ) + 1 ),
'Table'[Date]
),
MAX ( 'Table'[Date] )
)
)
VAR Calendar2 =
ADDCOLUMNS ( Calendar1, "WeekDay", WEEKDAY ( [Date], 2 ) )
RETURN
COUNTX ( FILTER ( Calendar2, [WeekDay] < 6 ), [Date] )
Get the result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Lior0707 Net Work Days - Microsoft Power BI Community
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 |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |