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 want to count # of complaints group by created month and year using DAX commands. Complaint # is unique.
Sample data – ComplaintTable:
ComplaintNum CreatedDate
CO1 20181102
CO2 20181104
CO3 20181228
CO4 20190115
CO5 20190220
CO6 20190229
CO7 20190305
CO8 20190407
Results:
Created Date Total
2018-11 2
2018-12 1
2019-01 1
2019-02 2
2019-03 1
2019-04 1
I built this DAX column but it seems not working:
TotalComplaintCreated =
COUNTROWS (
FILTER (
ComplaintTable,
ComplaintTable[ComplaintNum] = EARLIER(ComplaintTable[ComplaintNum])
&& MONTH (ComplaintTable[CreatedDate]) = MONTH(EARLIER(ComplaintTable[CreatedDate]))
&& YEAR (ComplaintTable[CreatedDate]) = YEAR(EARLIER(ComplaintTable[CreatedDate]))
))
Does anyone know why? Thanks.
@nora_cy_lee convert your created dte column in date data type instead of number/text in current format and then it is super easy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I can confirm the date is 'm/d/yyyy'. I believe I found the problem and it seems working now. Thanks.
CreatedDate is already in date format, yyyymmdd.
@nora_cy_lee you see it as date type but if you go on modelling tab, select your created date column, what you see its' data type?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 | |
| 73 | |
| 50 | |
| 47 | |
| 44 |