Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Create a measure as observation

Hi Everyone,

 

Year MonthIDOBS
2018-07A1
2018-07B2
2018-08C1
2018-09D1
2018-09E2
2018-09F3

 

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!

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You should first add an index column in Query Editor mode.

2.PNG

 

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] )
    )
)

3.PNG

 

Alternatively, you can achieve this via Power Query.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You should first add an index column in Query Editor mode.

2.PNG

 

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] )
    )
)

3.PNG

 

Alternatively, you can achieve this via Power Query.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors