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
PBI_newuser
Post Prodigy
Post Prodigy

ENDOFMONTH duplicates error

Hi, I got an error for the below column. How to correct it?
A date column containing duplicate dates was specified in the call to function 'ENDOFMONTH'. This is not supported.

 

Flag = 

if(AND (MONTH(Append[Travel Date])=MONTH(Append[Restoration Date]) , YEAR(Append[Travel Date])=YEAR(Append[Restoration Date])),1,
if(AND( Append[Travel Date] = ENDOFMONTH(Append[Travel Date]) ,
(((Year(Append[Restoration Date])-Year(Append[Travel Date]))*12) + Month(Append[Restoration Date])-Month(Append[Travel Date]))<=1),1,0))
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PBI_newuser ,based on what I got try like

if(eomonth(Append[Travel Date],0)=eomonth(Append[Restoration Date].0) ,1,
if(AND( Append[Travel Date] = eomonth(Append[Travel Date],0) ,
(datediff(Append[Restoration Date], Append[Travel Date], month)<=1),1,0)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @PBI_newuser ,

 

Or is this what you want?

v-lionel-msft_0-1619415858379.png

Flag = 
IF(
    MONTH([Travel Date]) = MONTH([Restoration Date]) && YEAR([Travel Date]) = YEAR([Restoration Date]),
    1,
    IF(
       [Restoration Date] = ENDOFMONTH('Append'[Travel Date]) && DATEDIFF([Restoration Date], [Travel Date], MONTH ) <=1,
        1, 0
    )
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@PBI_newuser ,based on what I got try like

if(eomonth(Append[Travel Date],0)=eomonth(Append[Restoration Date].0) ,1,
if(AND( Append[Travel Date] = eomonth(Append[Travel Date],0) ,
(datediff(Append[Restoration Date], Append[Travel Date], month)<=1),1,0)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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