Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Month and Year | PERSON ID 135 | PERSON ID 721 | PERSON ID 1003 | Total |
January 2019 | (31-4) | 27 | ||
February 2019 | (28-6) | 22 | ||
March 2019 | (31-1) | (31-4) | 26 | |
June 2019 | (30-23) | 7 | ||
July 2019 | (31-20) | 11 | ||
August 2019 | (31-2) | 29 | ||
September 2019 | (30-4) | 26 |
I've created a cross join table to count the difference between two dates and present them in a month format (above):
Solved! Go to Solution.
Hi @Anonymous ,
I made upadate on the formula of Meaure 3, now it can get the correct result...
Measure 3 = VAR _Month = EOMONTH ( DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ), 0 ) VAR _lastday = COUNTROWS ( FILTER ( 'DimDate', 'DimDate'[Date] >= DATE ( YEAR ( _Month ), MONTH ( _Month ), 1 ) && 'DimDate'[Date] <= _Month && NOT ( WEEKDAY ( [Date] ) IN { 1, 7 } ) ) ) RETURN IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay] |
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
@Anonymous , refer my file , where I have distributed leave across days
https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0
I have not checked your file
If I have created a measure:
Hi @Anonymous ,
I created two measures as below to get the working days and applied the new measure [Measure 2] on the matrix to replace the measure [AbsentByDay]. You can find the details in the attachment.
Measure =
VAR _lastday =
DAY (
EOMONTH (
DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ),
0
)
)
RETURN
IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay]
Measure 2 = SUMX(VALUES('DimDate'[Month Year]),[Measure])
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
This works great for full month figures. Thank you so much for this. Is there a way to apply just working days to this?
e.g. NOT WEEKDAY( 'DimDate'[Date] ) IN { 1,7 }
to
I have an almost 100% solution to this:
Hi @Anonymous ,
I made upadate on the formula of Meaure 3, now it can get the correct result...
Measure 3 = VAR _Month = EOMONTH ( DATE ( LEFT ( MAX ( 'DimDate'[Month Year] ), 4 ), VALUE ( RIGHT ( MAX ( 'DimDate'[Month Year] ), 2 ) ), 1 ), 0 ) VAR _lastday = COUNTROWS ( FILTER ( 'DimDate', 'DimDate'[Date] >= DATE ( YEAR ( _Month ), MONTH ( _Month ), 1 ) && 'DimDate'[Date] <= _Month && NOT ( WEEKDAY ( [Date] ) IN { 1, 7 } ) ) ) RETURN IF ( ISBLANK ( [AbsentByDay] ), BLANK (), _lastday ) - [AbsentByDay] |
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
68 | |
49 | |
45 |
User | Count |
---|---|
213 | |
86 | |
78 | |
63 | |
54 |