Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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! |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 71 | |
| 50 | |
| 46 | |
| 44 |