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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.