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
Hi Everyone,
| Year Month | ID | OBS |
| 2018-07 | A | 1 |
| 2018-07 | B | 2 |
| 2018-08 | C | 1 |
| 2018-09 | D | 1 |
| 2018-09 | E | 2 |
| 2018-09 | F | 3 |
I have a simple table like this and would like to create a measure (OBS) to display the record count of each month.
Could anyone tell me how to make it happen in DAX? Thank you in advance for the support!
Solved! Go to Solution.
Hi @Anonymous,
You should first add an index column in Query Editor mode.
Then, create below measure.
OBS =
COUNTROWS (
FILTER (
ALL ( 'Table2 2' ),
'Table2 2'[Year Month] = SELECTEDVALUE ( 'Table2 2'[Year Month] )
&& 'Table2 2'[Index] <= MAX ( 'Table2 2'[Index] )
)
)
Alternatively, you can achieve this via Power Query.
Best regards,
Yuliana Gu
Hi @Anonymous,
You should first add an index column in Query Editor mode.
Then, create below measure.
OBS =
COUNTROWS (
FILTER (
ALL ( 'Table2 2' ),
'Table2 2'[Year Month] = SELECTEDVALUE ( 'Table2 2'[Year Month] )
&& 'Table2 2'[Index] <= MAX ( 'Table2 2'[Index] )
)
)
Alternatively, you can achieve this via Power Query.
Best regards,
Yuliana Gu
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 |
|---|---|
| 58 | |
| 45 | |
| 40 | |
| 21 | |
| 18 |