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.
I have the below table. I am trying to calculate the active IDs as of every month end. Tried subtracting distinct ID count-distinct resolved count but that doesn't accommodate cases where IDs are reactivated(like ID 4 in the below dataset). please help.
ID | CreateDate | Status change date | changeDateEOM | Status |
1 | 3-Jan-22 | 1/12/2022 | 31-Jan-22 | Active |
2 | 5-Jan-22 | 1/13/2022 | 31-Jan-22 | Active |
2 | 5-Jan-22 | 2/2/2022 | 28-Feb-22 | Resolved |
3 | 5-Jan-22 | 1/5/2022 | 31-Jan-22 | Active |
3 | 5-Jan-22 | 2/20/2022 | 28-Feb-22 | Resolved |
4 | 5-Jan-22 | 1/5/2022 | 31-Jan-22 | Active |
4 | 5-Jan-22 | 2/3/2022 | 28-Feb-22 | Resolved |
4 | 5-Jan-22 | 3/3/2022 | 31-Mar-22 | Active |
5 | 5-Jan-22 | 1/5/2022 | 31-Jan-22 | Active |
5 | 5-Jan-22 | 2/3/2022 | 28-Feb-22 | Resolved |
5 | 5-Jan-22 | 3/3/2022 | 31-Mar-22 | Resolved |
6 | 5-Jan-22 | 2/3/2022 | 28-Feb-22 | Active |
6 | 5-Jan-22 | 3/3/2022 | 31-Mar-22 | Resolved |
expected result
endofmonth | ActiveCount |
31-Jan-22 | 6 |
28-Feb-22 | 2 |
31-Mar-22 | 2 |
notes |
All 6 IDs are active by end of jan |
1&6 are active by end of feb |
1&4 are active by end of mar(4 was reactivated) |
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL Thank you so much for this. Is there a way to make this measure work when I am slicing it using other columns. For example the term column like the below?
ID | CreateDate | Status change date | changeDateEOM | Status | Term |
1 | 1/3/2022 | 1/12/2022 | 1/31/2022 | Active | Short Term |
2 | 1/5/2022 | 1/13/2022 | 1/31/2022 | Active | Short Term |
2 | 1/5/2022 | 2/2/2022 | 2/28/2022 | Resolved | Medium Term |
3 | 1/5/2022 | 1/5/2022 | 1/31/2022 | Active | Short Term |
3 | 1/5/2022 | 2/20/2022 | 2/28/2022 | Resolved | Short Term |
4 | 1/5/2022 | 1/5/2022 | 1/31/2022 | Active | Short Term |
4 | 1/5/2022 | 2/3/2022 | 2/28/2022 | Resolved | Short Term |
4 | 1/5/2022 | 3/3/2022 | 3/31/2022 | Active | Long Term |
5 | 1/5/2022 | 1/5/2022 | 1/31/2022 | Active | Medium Term |
5 | 1/5/2022 | 2/3/2022 | 2/28/2022 | Resolved | Medium Term |
5 | 1/5/2022 | 3/3/2022 | 3/31/2022 | Resolved | Medium Term |
6 | 1/5/2022 | 2/3/2022 | 2/28/2022 | Active | Short Term |
6 | 1/5/2022 | 3/3/2022 | 3/31/2022 | Resolved | Short Term |
expected result - return the term count for active cases
End of month | Long Term | Medium Term | Short Term |
31-Jan-22 | 0 | 1 | 5 |
28-Feb-22 | 0 | 0 | 2 |
31-Mar-22 | 1 | 0 | 1 |
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |