Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I am trying to writing a measure that return the count of active patient of the previous month. I have written a measure that return the count of previous year working. But when I expand to month level, it is not working. Here is my Measure:
I don't know how to write the DAX measure that return the previous month, since some months are 31 days and some are 30 days.
As shown in the figure below, Oct 2002 should return 31, Nov 2022 should return 92.
\
Solved! Go to Solution.
Sorry:
Active Base Count PM = CALCULATE([Active Base count], PREVIOUSMONTH(DimDates[Date]))
Hello:
Sorry:
Active Base Count PM = CALCULATE([Active Base count], PREVIOUSMONTH(DimDates[Date]))
DATESINPERIOD() comes into play.
| 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! |
I tried this measure but it's not giving what I want.
Not surprising at all that you can't get the right answer. You should learn DAX from scratch, the very first thing is that DAX is NOT Excel worksheet formula; DAX formula is very sensetive to the context where it evaluates. Thus, any discussion over DAX without dataset model is nothing but gibberish.
| 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! |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |