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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors