Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to count the number of records within a month and put it in a calculated column so I can use it in another column based calculation.
Basically, I need to get the count like this:
Solved! Go to Solution.
@Anonymous
Hello, try with this in a calculated column
Recordsinthemonth = VAR MonthinRow=MONTH(Table1[Date]) RETURN COUNTROWS(FILTER(All(Table1),MONTH(Table1[Date])=MonthinRow))
Regards
Victor
Lima - Peru
@Anonymous
Hello, try with this in a calculated column
Recordsinthemonth = VAR MonthinRow=MONTH(Table1[Date]) RETURN COUNTROWS(FILTER(All(Table1),MONTH(Table1[Date])=MonthinRow))
Regards
Victor
Lima - Peru
That worked so easily. I just started learning DAX and all the solutions I could think of were within its own bounds, ironically, like my problem here.
Hello,
Since you just started learning DAX it's a good idea to be able to think about different solutions to your problems. In case if you are in that pre-variables DAX environment SSAS 2012 or Excel < 2016 here is the solution to question with EARLIER()
Count = COUNTROWS( FILTER( Table1, MONTH(Table1[Date]) = MONTH(EARLIER(Table1[Date])) ) )
Nick -
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |