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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DPozo
New Member

Problems with EARLIER

Hi everyone,

 

I got a table like this:

 

WEEKBELLREJECTED

1

11
121
112
123
2125
2226
214
222
210

 

I would like to measure whats the maximum total value for every bell by week.
For example: in the previous table, if I select "WEEK 1", the measure must show 4 (3+1 > 1+2). For "WEEK 2", the measure must show 29 (25+4 > 26 + 2).

I have this DAX code:

Value =
CALCULATE (
    SUM ( LEAKDETAILS[REJECTED] ),
    LEAKDETAILS[BELL] = EARLIER(LEAKDETAILS[BELL]),
    LEAKDETAILS[WEEK] = EARLIER(LEAKDETAILS[WEEK])
)
But I have an error in the EARLIER. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can use a measure like this - taking the Top 1 descending

Top1 = SUMX(
        TOPN(
            1,
            SUMMARIZE(
                    WeekBellRejected,
                    WeekBellRejected[Bell],
                    "TotalRejected", SUM(WeekBellRejected[Rejected])
            ),
            [TotalRejected], DESC
        ),
        [TotalRejected]
)
 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

You can use a measure like this - taking the Top 1 descending

Top1 = SUMX(
        TOPN(
            1,
            SUMMARIZE(
                    WeekBellRejected,
                    WeekBellRejected[Bell],
                    "TotalRejected", SUM(WeekBellRejected[Rejected])
            ),
            [TotalRejected], DESC
        ),
        [TotalRejected]
)
 

It works perfectly! Thanks!
Anonymous
Not applicable

Top1 = SUMX(
        TOPN(
            1,
            SUMMARIZE(
                    WeekBellRejected,
                    WeekBellRejected[Bell],
                    "TotalRejected", SUM(WeekBellRejected[Rejected])
            ),
            [TotalRejected], DESC
        ),
        [TotalRejected]
)
 
Anonymous
Not applicable

Use TOPN function with Top 1 - TOPN function (DAX) - DAX | Microsoft Learn

I don't understand your answer.

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 Solution Authors
Top Kudoed Authors