The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I have a table called Agency Workers The data has a Month Field Column B. I then want to create a matrix which calculates
the DISTINCT number of LinkID Column E for each month where the End date in Role Column D is between the Month Field For example:-
For Month May 2024 calculate the distinct LinkID where End date in Role Between 01/05/2024 – 31/05/2024 = 33 Records
For Month June 2024 calculate the distinct LinkID where End Date in Role Between 01/06/2024 – 30/06/2024 = 24 Records
For Month July 2024 calculate the distinct LinkID where End date in Role Between 01/07/2024 – 31/07/2024 = 33 Records
I tried the following DAX but the values are not working.
End Date Numbers = CALCULATE( DISTINCTCOUNT('Agency Workers'[LinkID]),
FILTER( 'Agency Workers', 'Agency Workers'[End date in role] >= DATE(YEAR('Agency Workers'[Month]), MONTH('Agency Workers'[Month]), 1) && 'Agency Workers'[End date in role] <= EOMONTH('Agency Workers'[Month], 0) ) )
I would like the format as the following so I will put the Month field in the as a Row and the End Date Numbers as a Value
Can someone please write the DAX measure for this result
Financial Year | Month | Start Date in Role | End date in role | LinkID | Index |
2024-25 | Jul-24 | 27/02/2024 | 23/07/2024 | ADEJ Recruitment Ltd | 4612 |
2024-25 | Jul-24 | 02/04/2024 | 09/07/2024 | ANDM Temp Recruitment Ltd | 4570 |
2024-25 | May-24 | 29/04/2024 | 17/05/2024 | ANGD Sanctuary Personnel Limited | 3929 |
2024-25 | Jul-24 | 04/01/2024 | 23/07/2024 | ANGDTemp Recruitment Ltd | 4605 |
2024-25 | May-24 | 01/11/2023 | 17/05/2024 | ANGH Temp Recruitment Ltd | 4099 |
2024-25 | Jul-24 | 18/03/2024 | 23/07/2024 | ANNMTemp Recruitment Ltd | 4614 |
2024-25 | Jun-24 | 04/06/2024 | 13/06/2024 | ANTT Temp Recruitment Ltd | 4275 |
2024-25 | May-24 | 08/09/2023 | 24/05/2024 | ARSH Temp Recruitment Ltd | 4114 |
2024-25 | Jun-24 | 25/06/2024 | 28/06/2024 | AZAP Temp Recruitment Ltd | 4268 |
2024-25 | Jun-24 | 15/04/2024 | 10/06/2024 | BRAA Temp Recruitment Ltd | 4291 |
2024-25 | Jul-24 | 03/05/2024 | 05/07/2024 | BRAI Temp Recruitment Ltd | 4573 |
2024-25 | May-24 | 15/04/2024 | 31/05/2024 | CARJ Temp Recruitment Ltd | 4084 |
2024-25 | May-24 | 01/09/2022 | 30/05/2024 | CARS Sellick Partnership Limited | 3873 |
2024-25 | Jun-24 | 07/08/2023 | 03/07/2024 | CHEW Caritas Recruitment Limited | 4135 |
2024-25 | Jul-24 | 03/01/2024 | 23/07/2024 | CHRP Temp Recruitment Ltd | 4597 |
2024-25 | May-24 | 21/05/2024 | 24/05/2024 | CHRS Temp Recruitment Ltd | 4029 |
2024-25 | Jul-24 | 08/01/2024 | 23/07/2024 | CHRO Temp Recruitment Ltd | 4608 |
2024-25 | May-24 | 20/10/2023 | 10/05/2024 | COLA Temp Recruitment Ltd | 4087 |
2024-25 | Jul-24 | 04/01/2024 | 23/07/2024 | DAVB Temp Recruitment Ltd | 4606 |
2024-25 | May-24 | 02/04/2024 | 03/05/2024 | DAVA Temp Recruitment Ltd | 4059 |
2024-25 | Jul-24 | 15/04/2024 | 23/07/2024 | DAVB Temp Recruitment Ltd | 4598 |
2024-25 | Jun-24 | 21/05/2024 | 06/06/2024 | DAVD Temp Recruitment Ltd | 4252 |
2024-25 | May-24 | 26/02/2024 | 20/05/2024 | DAWD Eden Brown Limited | 3911 |
2024-25 | Jul-24 | 18/09/2023 | 12/07/2024 | DEBD Temp Recruitment Ltd | 4603 |
2024-25 | Jun-24 | 05/04/2024 | 07/06/2024 | ETHB Temp Recruitment Ltd | 4246 |
2024-25 | Jun-24 | 06/02/2024 | 28/06/2024 | EVIG Derbyshire Caritas Recruitment Limited | 4152 |
2024-25 | May-24 | 20/09/2023 | 10/05/2024 | FARA Temp Recruitment Ltd | 4097 |
2024-25 | May-24 | 25/05/2024 | 25/05/2024 | FREY Temp Recruitment Ltd | 4070 |
2024-25 | May-24 | 08/09/2023 | 24/05/2024 | GARL Temp Recruitment Ltd | 4081 |
2024-25 | Jul-24 | 24/06/2024 | 23/07/2024 | GILM Temp Recruitment Ltd | 4619 |
2024-25 | May-24 | 18/09/2023 | 24/05/2024 | GURS Temp Recruitment Ltd | 4089 |
2024-25 | May-24 | 10/07/2023 | 03/05/2024 | IANL Temp Recruitment Ltd | 4078 |
2024-25 | Jul-24 | 14/11/2022 | 05/07/2024 | IANM Temp Recruitment Ltd | 4554 |
2024-25 | May-24 | 09/04/2024 | 03/05/2024 | JACG Temp Recruitment Ltd | 4019 |
2024-25 | Jul-24 | 22/04/2024 | 26/07/2024 | JACH Eden Brown Limited | 4396 |
2024-25 | May-24 | 05/02/2024 | 24/05/2024 | JACD Temp Recruitment Ltd | 4122 |
2024-25 | Jul-24 | 24/03/2021 | 05/07/2024 | JAMC Temp Recruitment Ltd | 4553 |
2024-25 | May-24 | 02/04/2024 | 31/05/2024 | JAMD Temp Recruitment Ltd | 4052 |
2024-25 | May-24 | 12/09/2022 | 29/05/2024 | JANW Eden Brown Limited | 3874 |
2024-25 | Jun-24 | 15/04/2024 | 01/06/2024 | JERA STANDBY HEALTHCARE (NORTH) LTD | 4178 |
2024-25 | Jun-24 | 01/04/2024 | 27/06/2024 | JOAC Randstad Solutions Limited | 4171 |
2024-25 | May-24 | 04/03/2024 | 10/05/2024 | JOHM Temp Recruitment Ltd | 4005 |
2024-25 | May-24 | 06/02/2024 | 03/05/2024 | JOSW Temp Recruitment Ltd | 4033 |
2024-25 | May-24 | 04/09/2023 | 03/05/2024 | JULD Temp Recruitment Ltd | 4094 |
2024-25 | May-24 | 22/11/2023 | 17/05/2024 | KATW Temp Recruitment Ltd | 4100 |
2024-25 | Jun-24 | 21/12/2023 | 07/06/2024 | KEIA Temp Recruitment Ltd | 4244 |
2024-25 | May-24 | 15/09/2023 | 03/05/2024 | KEIH Temp Recruitment Ltd | 4096 |
2024-25 | Jul-24 | 05/09/2016 | 19/07/2024 | KENL Temp Recruitment Ltd | 4537 |
2024-25 | May-24 | 08/09/2023 | 10/05/2024 | KEVG Temp Recruitment Ltd | 4079 |
2024-25 | Jun-24 | 15/04/2024 | 10/06/2024 | KEVT Temp Recruitment Ltd | 4303 |
2024-25 | Jun-24 | 05/04/2024 | 07/06/2024 | LEOW Temp Recruitment Ltd | 4277 |
2024-25 | Jul-24 | 16/04/2024 | 07/07/2024 | LEWR Temp Recruitment Ltd | 4545 |
2024-25 | Jun-24 | 04/09/2023 | 14/06/2024 | LISSTemp Recruitment Ltd | 4328 |
2024-25 | Jul-24 | 09/04/2024 | 23/07/2024 | LUCK Temp Recruitment Ltd | 4617 |
2024-25 | May-24 | 05/04/2024 | 03/05/2024 | LUKM Temp Recruitment Ltd | 4022 |
2024-25 | May-24 | 04/12/2023 | 31/05/2024 | LYNM Sanctuary Personnel Limited | 3891 |
2024-25 | Jun-24 | 04/12/2023 | 04/06/2024 | LYNM Sanctuary Personnel Limited | 4142 |
2024-25 | Jul-24 | 30/03/2023 | 05/07/2024 | MART Temp Recruitment Ltd | 4557 |
2024-25 | Jul-24 | 05/04/2024 | 05/07/2024 | MARW Temp Recruitment Ltd | 4552 |
2024-25 | Jul-24 | 09/10/2023 | 01/07/2024 | MATB Temp Recruitment Ltd | 4601 |
2024-25 | Jul-24 | 15/01/2024 | 23/07/2024 | MERD Temp Recruitment Ltd | 4607 |
2024-25 | May-24 | 16/04/2024 | 01/05/2024 | MERM emp Recruitment Ltd | 4024 |
2024-25 | Jul-24 | 04/09/2023 | 01/07/2024 | MIRE Temp Recruitment Ltd | 4602 |
2024-25 | Jul-24 | 15/01/2024 | 23/07/2024 | MOHK Temp Recruitment Ltd | 4610 |
2024-25 | May-24 | 08/09/2023 | 10/05/2024 | MONM l Temp Recruitment Ltd | 4092 |
2024-25 | Jul-24 | 15/04/2024 | 23/07/2024 | NASR Temp Recruitment Ltd | 4616 |
2024-25 | Jun-24 | 20/11/2023 | 14/06/2024 | NATC Temp Recruitment Ltd | 4331 |
2024-25 | May-24 | 08/01/2024 | 10/05/2024 | NICE Temp Recruitment Ltd | 4083 |
2024-25 | Jun-24 | 14/02/2024 | 27/06/2024 | NIGC Corepeople Recruitment Limited | 4155 |
2024-25 | Jun-24 | 27/02/2024 | 14/06/2024 | NIKJ Sanctuary Personnel Limited | 4157 |
2024-25 | Jun-24 | 27/05/2024 | 28/06/2024 | PAMSRandstad Solutions Limited | 4179 |
2024-25 | Jul-24 | 05/02/2024 | 05/07/2024 | PHIM Temp Recruitment Ltd | 4561 |
2024-25 | Jun-24 | 15/04/2024 | 21/06/2024 | REBW Temp Recruitment Ltd | 4346 |
2024-25 | May-24 | 06/11/2023 | 24/05/2024 | REGA Temp Recruitment Ltd | 4104 |
2024-25 | Jul-24 | 08/01/2024 | 23/07/2024 | RESE Temp Recruitment Ltd | 4609 |
2024-25 | Jul-24 | 04/06/2024 | 26/07/2024 | RILH Temp Recruitment Ltd | 4565 |
2024-25 | Jul-24 | 05/04/2024 | 30/07/2024 | ROBB Temp Recruitment Ltd | 4524 |
2024-25 | May-24 | 20/11/2023 | 19/05/2024 | ROBT Service Care Solutions Limited | 3890 |
2024-25 | May-24 | 14/05/2024 | 04/06/2024 | SARD Ross Staffing Solutions Limited | 3950 |
2024-25 | Jun-24 | 14/05/2024 | 05/06/2024 | SARD Ross Staffing Solutions Limited | 4187 |
2024-25 | Jul-24 | 04/01/2024 | 23/07/2024 | SARJ Temp Recruitment Ltd | 4604 |
2024-25 | Jun-24 | 06/11/2023 | 28/06/2024 | SARS Temp Recruitment Ltd | 4332 |
2024-25 | Jun-24 | 04/09/2023 | 27/06/2024 | SHAB Temp Recruitment Ltd | 4234 |
2024-25 | May-24 | 04/09/2023 | 10/05/2024 | STAC Temp Recruitment Ltd | 4090 |
2024-25 | Jun-24 | 15/04/2024 | 28/06/2024 | STEH Temp Recruitment Ltd | 4320 |
2024-25 | Jun-24 | 08/09/2023 | 28/06/2024 | STEH Temp Recruitment Ltd | 4321 |
2024-25 | Jul-24 | 04/04/2022 | 05/07/2024 | STEW Temp Recruitment Ltd | 4559 |
2024-25 | Jun-24 | 04/12/2023 | 14/06/2024 | TAMS Temp Recruitment Ltd | 4333 |
2024-25 | May-24 | 28/11/2023 | 24/05/2024 | THEA Temp Recruitment Ltd | 4102 |
2024-25 | Jul-24 | 15/04/2024 | 23/07/2024 | TINC Temp Recruitment Ltd | 4615 |
2024-25 | Jun-24 | 22/09/2023 | 07/06/2024 | TRAB Temp Recruitment Ltd | 4329 |
2024-25 | Jul-24 | 03/06/2024 | 23/07/2024 | VICB Temp Recruitment Ltd | 4618 |
@Anonymous @danextian @lbendlin @Greg_Deckler
Solved! Go to Solution.
Hi @spandy34 ,
it is good to know [month] is actually date type, try like:
measure =
CALCULATE(
DISTINCTCOUNT(data[LinkID]),
FILTER(
data,
EOMONTH(data[end date in role], 0) = EOMONTH(data[month], 0)
)
)
it worked like:
Hi @spandy34 ,
try to plot a visual with Month column and a measure like:
measure =
CALCULATE(
DISTINCTCOUNT(data[LinkID]),
FORMAT(data[end date in role], "mmm-yy") = MAX(data[month])
)
it worked like:
When setting the Month format to Date I get Error in Column field but if I put the Month to Text I get all the values in Month Column to False even though there should be True entries and my Table Visualisation looks like this
Hi @spandy34 ,
it is good to know [month] is actually date type, try like:
measure =
CALCULATE(
DISTINCTCOUNT(data[LinkID]),
FILTER(
data,
EOMONTH(data[end date in role], 0) = EOMONTH(data[month], 0)
)
)
it worked like:
Thank you so much . That has worked . I appreciate your help
The figures aren't quite adding up so I'll do a bit of digging around and see what is going on but it's good I've got a base to work with . I'll keep you informed how I get on . I'm in hospital so will look at it on Monday and let you know .
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |