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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Kritika_
Frequent Visitor

Still getting error with IFERROR()

I have used this measure to calculate the ytd of the selectedYear-1 :
CALCULATE
(
        SUM(v_f_oppor_apac[line item amount nypmar]),
        OpportunityStage[OpportunityStage_Harmonized] = "Won",
        SAMEPERIODLASTYEAR(d_date_closed[day_dt]),
        v_f_oppor_apac[K_YTDDatePrevYear] = TRUE()
    )  

  //[K_YTDDatePrevYear]: this measure is flag that marks all the dates till today of previous yr as TRUE().


But I'm getting the error when I select the yr 2024 from the filter:
Kritika__0-1686314505349.png

And even after using the functions IFERROR() and ISERROR() I'm still getting the same error.
Can anyone let me know what I'm doing wrong here.

Thankyou for your time!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Kritika_ 

Please check the following

1.Whether your date table is in a one-to-many relationship with the data table, and if it is a many-to-many relationship, the error shown in the figure may occur

2.Whether your date table and data table are one-way joins.

You can refer to the following link.

Solved: Contiguous date selection error - YTD LY - Microsoft Fabric Community

Solved: Function 'SAMEPERIODLASTYEAR' expects a contiguous... - Microsoft Fabric Community

 

Best Regards!

Yolo Zhu

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Kritika_ 

Please check the following

1.Whether your date table is in a one-to-many relationship with the data table, and if it is a many-to-many relationship, the error shown in the figure may occur

2.Whether your date table and data table are one-way joins.

You can refer to the following link.

Solved: Contiguous date selection error - YTD LY - Microsoft Fabric Community

Solved: Function 'SAMEPERIODLASTYEAR' expects a contiguous... - Microsoft Fabric Community

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors