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
Armas
Frequent Visitor

Last estimate of latest date filtered by another colum

Hi. 

I have a dataset where users report on the same estimate over and over again. 

I need my rapport to only show the latest estimate. 

So they will report estimated sales for July in April, May and June, resulting in three different estimates for July. 

I then want to filter out the latest estimate, for each user, for each month. As shown in the table below (Last est sales)

As this: 

Armas_0-1732203498933.png

 

 

I managed to find a measure that fiters by month, but i need it to also filter by user. 

 

Last est sales = calculate(
    LASTNONBLANKVALUE('Table'[Reporting date],
     max('Table'[Est sales])),
     filter(
        ALLSELECTED('Table'),
        'Table'[Month] = max('Table'[Month])
         )
         )
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Armas 

Please try

Last est sales =
SUMX (
Vales ( 'Table'[User] ),
SUMX (
TOPN (
1,
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[User] = EARLIER ( 'Table'[User] ) ),
'Table'[Month]
),
'Table'[Est sales]
)
)

View solution in original post

12 REPLIES 12
Anonymous
Not applicable

Hi @Armas ,

 

How is the situation now? If the problem has been solved, please accept the answers you find helpful as solutions.

You can also try this.

VAR filtered = FILTER(ALLSELECTED('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[User]=MAX('Table'[User]))
VAR last_date = MAXX(filtered,'Table'[Reporting date])
RETURN IF(MAX('Table'[Reporting date])=last_date,MAX('Table'[est sales]),"")

vmengmlimsft_0-1732527734959.png

 

 

 

 

Best regards,

Mengmeng Li

Thanks for following up :). 

After trying several of the solutions, and using the results in new measures and visuales I ended up with a good solution. 

I will look into this solution as well, as it might simplyfy the report. Thanks for the reply. 

ThxAlot
Super User
Super User

ThxAlot_0-1732285139200.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Armas
Frequent Visitor

Thanks! 

I will test this as well, but everything worked great with the table-solution from tamerj1

FreemanZ
Super User
Super User

hi @Armas ,

 

if the screenshot is a visual, try like:

measure =

VAR _lastdate =

CALCULATE(

MAX(data[reporting date]),

ALLEXCEPT(data, data[user], data[month])

)

RETURN

IF(MAX(data[reporting date]) = _lastdate, SUM(data[Est sales]), BLANK())

Couldn't get this to work properly, and there was another reply with the new table that worked perfectly. 

Thanks anyway 🙂

@FreemanZ 

The column would work perfectly but the measure would produce wrong total. 

yes, indeed SUMX(VALUES(), ) is much safer and more robust to ensure a consistent total. 

FreemanZ
Super User
Super User

hi @Armas ,

 

try to add a calculated column like:

 

column=

VAR _lastdate =

CALCULATE(

MAX(data[reporting date]),

ALLEXCEPT(data, data[user], data[month])

)

RETURN

IF(data[reporting date] = _lastdate, data[Est sales], BLANK())

Thanks! This worked, but the table-solution was easier for continued use of the data. 

tamerj1
Super User
Super User

Hi @Armas 

Please try

Last est sales =
SUMX (
Vales ( 'Table'[User] ),
SUMX (
TOPN (
1,
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[User] = EARLIER ( 'Table'[User] ) ),
'Table'[Month]
),
'Table'[Est sales]
)
)

Armas
Frequent Visitor

Thanks! A new table was the best solution for me. This worked great 🙂

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.