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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
vickyprudhvi
Helper IV
Helper IV

Error in PowerBI Deskopt using LastDate function

Hi Friends,

I am using lastdate function in my tabular model.

Following is my measure

SUMX(VALUES(ClaimRoot[Claim Number]),
                                           CALCULATE(  SUM(ClaimRoot[ThreePointDaysQuantity]),LASTDATE(ClaimRoot[EffectiveTimestamp]))
                                          )

 

In PowerBi Dektop I am getting following error

A date Column containing duplicate dates was specified in the call to function 'LastDate'. This is not supported

 

Please help

 

4 REPLIES 4
v-sihou-msft
Microsoft Employee
Microsoft Employee

Hi @vickyprudhvi,

 

In DAX, when adding filters in CALCULATE() function, it must be either a boolean expression or a table expression that defines a filter. And the LASTDATE() returns a table containing a single column and single row with a date value. So the syntax of your DAX is correct. In this scenario, you need to check if there are duplicated rows in Cl​aimRoot[EffectiveTimestamp] column as the error message mentioned.

 

Regards,

vickyprudhvi
Helper IV
Helper IV

@austinsense - Pls help

@vickyprudhvi Tell us more about the table you are working on. The formula by iteslf seems okay

austinsense
Impactful Individual
Impactful Individual

Also it would help if you write out in a sentence what you want the measure to calculate. I's like DAX poetry, bonus point for a haiku ...

 

every claim number,

sum "three points day quantity",

last day in filter

 

I don't think you can throw a function like that into the second argument of a calculate.  you might need this ...

 

SUMX(VALUES(ClaimRoot[Claim Number]),
     CALCULATE(  SUM(ClaimRoot[ThreePointDaysQuantity]),
          FILTER(ClaimRoot,
Cl​aimRoot[EffectiveTimestamp] = LASTDATE(Cl​aimRoot[EffectiveTimestamp]
)
)
)
Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors