Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |