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
biswad
Advocate I
Advocate I

How to calculate Average member joined in last 30 days

Hi All, 

I have a table which has created on date and membership ID. I would like to calculate the average number of member joined in the last 30 days. Any help on this would be greatly appriciated. 

 

 

biswad_0-1729081272981.png

 

1 ACCEPTED SOLUTION
lucadelicio
Super User
Super User

hi @biswad 

try this measure:
Average Members Joined
in Last 30 Days =
VAR Last30DaysMembers =
    CALCULATE(
        COUNTROWS(Table1),
        FILTER(
            Table1,
            Table1[Date] >= TODAY() - 30 &&
            Table1[Date] <= TODAY()
        )
    )
RETURN
    DIVIDE(Last30DaysMembers, 30)


Luca D'Elicio

LinkedIn Profile

View solution in original post

3 REPLIES 3
biswad
Advocate I
Advocate I

Thank you all for trying to help me on this problem. There are lot of things to take on, much appriciated everyone's effort. 

danextian
Super User
Super User

Hi @biswad 

 

I'm not sure how actual data really is but given the sample data, please try these:

30 Days Moving Average = 
VAR _Value =
    CALCULATE (
        SUM ( 'Table'[value] ),
        DATESINPERIOD ( 'Table'[Date], MAX ( 'Table'[Date] ), -30, DAY )
    )
VAR _Count =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Date] ),
        DATESINPERIOD ( 'Table'[Date], MAX ( 'Table'[Date] ), -30, DAY )
    )
RETURN
    DIVIDE ( _Value, _Count )


30 Days Moving Average 2  = 
VAR _Value =
    CALCULATE (
        SUM ( 'Table'[value] ),
        DATESINPERIOD ( 'Table'[Date], MAX ( 'Table'[Date] ), -30, DAY )
    )
RETURN
    DIVIDE ( _Value, 30)

30 Days Moving Average 3 = 
CALCULATE (
    AVERAGEX (
        ADDCOLUMNS (
            SUMMARIZE ( 'Table', 'Table'[Date] ),
            "@value", CALCULATE ( SUM ( 'Table'[value] ) )
        ),
        [@value]
    ),
    DATESINPERIOD ( 'Table'[Date], MAX ( 'Table'[Date] ), -30, DAY )
)

 

Please see attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
lucadelicio
Super User
Super User

hi @biswad 

try this measure:
Average Members Joined
in Last 30 Days =
VAR Last30DaysMembers =
    CALCULATE(
        COUNTROWS(Table1),
        FILTER(
            Table1,
            Table1[Date] >= TODAY() - 30 &&
            Table1[Date] <= TODAY()
        )
    )
RETURN
    DIVIDE(Last30DaysMembers, 30)


Luca D'Elicio

LinkedIn Profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.