The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Case ID | Location | Date |
1 | 123 | 9/22/21 |
2 | 456 | 9/1/21 |
3 | 678 | 6/24/21 |
4 | 123 | 7/15/21 |
5 | 123 | 9/5/21 |
Location | End Date |
123 | 8/25/21 |
123 | 9/30/21 |
678 | 6/30/21 |
I am trying to figure out how I would count the case ID's in the first table within 60 days of each respective location's contract end date. Some locations have multiple contract end date's, so I would also be trying to sum the results from both of those counts. I haven't had any luck setting up this formula yet.
Solved! Go to Solution.
Hi @kerya ,
You can create a measure like
Count =
SUMX (
'Table (2)',
CALCULATE (
COUNT ( 'Table'[Case ID] ),
FILTER (
'Table',
[Date] <= MAX ( 'Table (2)'[End Date] )
&& [Date]
>= MAX ( 'Table (2)'[End Date] ) - 60
)
)
)
Each row is the count corresponding to Location and End Date, and Total is the sum of all.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @kerya ,
You can create a measure like
Count =
SUMX (
'Table (2)',
CALCULATE (
COUNT ( 'Table'[Case ID] ),
FILTER (
'Table',
[Date] <= MAX ( 'Table (2)'[End Date] )
&& [Date]
>= MAX ( 'Table (2)'[End Date] ) - 60
)
)
)
Each row is the count corresponding to Location and End Date, and Total is the sum of all.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Show the expected result please.
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
27 |
User | Count |
---|---|
181 | |
88 | |
70 | |
48 | |
46 |