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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
RURURU
Frequent Visitor

Calculation of last 15 month from the point another measure = 1

hello guys, 
i have issue with dax measure.. 
i need a dax measure who calculate all fees from last 15 month but i need him to starts summring from the individual point for each payer which is dax measure as well who have a 1 or 0 value 
until now i tried a lot of versuin like that and keep getting this error 
A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

test measure  =
VAR LastChangeDate =
    CALCULATE (
        MAX (dimDate[Date]),
        [churn] = 1,
        dimDate[Date] > EDATE ( TODAY(), -15 ))
   
RETURN
    CALCULATE (
        [All Fees],
        FILTER (
            ALL ( dimDate[Date] ),
            dimDate[Date] > EDATE ( LastChangeDate, -15 )
                && dimDate[Date] <= LastChangeDate
        )
    )
try as well to use dateadd but keep getting this error.
how can i sum the last 15 month from the point [churn] = 1 
1 ACCEPTED SOLUTION

Try

test measure =
SUMX (
    VALUES ( 'Payer'[Payer ID] ),
    VAR LastChangeDate =
        CALCULATE (
            MAX ( dimDate[Date] ),
            FILTER (
                ALL ( dimDate[Date] ),
                [churn] = 1
                    && dimDate[Date] > EDATE ( TODAY (), -15 )
            )
        )
    RETURN
        IF (
            NOT ISBLANK ( LastChangeDate ),
            CALCULATE (
                [All Fees],
                FILTER (
                    ALL ( dimDate[Date] ),
                    dimDate[Date] > EDATE ( LastChangeDate, -15 )
                        && dimDate[Date] <= LastChangeDate
                )
            )
        )
)

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

You need to iterate over the individual payers, so that the calculation is done for each row. Try

test measure =
SUMX (
    VALUES ( 'Payer'[Payer ID] ),
    VAR LastChangeDate =
        CALCULATE (
            MAX ( dimDate[Date] ),
            [churn] = 1,
            dimDate[Date] > EDATE ( TODAY (), -15 )
        )
    RETURN
        IF (
            NOT ISBLANK ( LastChangeDate ),
            CALCULATE (
                [All Fees],
                FILTER (
                    ALL ( dimDate[Date] ),
                    dimDate[Date] > EDATE ( LastChangeDate, -15 )
                        && dimDate[Date] <= LastChangeDate
                )
            )
        )
)

A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed. 
getting this error again 

Try

test measure =
SUMX (
    VALUES ( 'Payer'[Payer ID] ),
    VAR LastChangeDate =
        CALCULATE (
            MAX ( dimDate[Date] ),
            FILTER (
                ALL ( dimDate[Date] ),
                [churn] = 1
                    && dimDate[Date] > EDATE ( TODAY (), -15 )
            )
        )
    RETURN
        IF (
            NOT ISBLANK ( LastChangeDate ),
            CALCULATE (
                [All Fees],
                FILTER (
                    ALL ( dimDate[Date] ),
                    dimDate[Date] > EDATE ( LastChangeDate, -15 )
                        && dimDate[Date] <= LastChangeDate
                )
            )
        )
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.