Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table that contains the names of users, and the date of payment for each one of them.
| Users | Date of payment |
| A | 12/12/2020 |
| B | 3/1/2021 |
| C | 9/8/2021 |
Power BI then automatically creates a hierarchy for the dates and thus shows me what the quarter is for each date. I would like to count the number of times the users have paid during each quarter.
So for example, I would like to know how many users paid us during Q1.
To do so, I need to count the number of times the quarters occur in the column, however, when I plug in this: "
Solved! Go to Solution.
Solved it! Just created another table in Power Query that contains the quarters and added a column for counts, and then the values turned out correct!
Solved it! Just created another table in Power Query that contains the quarters and added a column for counts, and then the values turned out correct!
Can you share PBX file to check
Proud to be a Super User! |
|
Sorry I can't share the file since it contains sensitive information. However I think I identified the problem. My table now looks like this:
| User | Quarter | Sum of occurence |
| A | Q3 | 13 |
| B | Q3 | 13 |
| C | Q3 | 13 |
| D | Q3 | 13 |
| E | Q4 | 15 |
| F | Q1 | 23 |
| G | Q3 | 26 |
So the problem is that it adds up the count for each quarter (for ex, Q3 for user G shows 26 which is 13+13), and then it adds 26 to 26 for other users etc... So it calculates it as a sum rather than a count
@AceB_ , Try updating measure as
Occurrence =
CALCULATE(
COUNTROWS('Table'),
ALLEXCEPT('Table', 'Table'[User]),
'Table'[Date of payment].[Quarter] = EARLIER('Table'[Date of payment].[Quarter])
)
Proud to be a Super User! |
|
Thank you for the answer!
When I plug in that measure, the occurrence shows up as a sum and this is what I get:
| Users | Quarter | Sum of Count |
| A | Q2 | 155 |
| B | Q2 | 31 |
| C | Q1 | 23 |
The numbers are still wrong and they change from row to row
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |