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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Error: 'A circular dependency was detected' when sort by Column on date table

Hello! I am getting an error when trying to sort by column in my Date table to have Fiscal Year & Month show in the correct order on visual. I am using the method found here https://www.youtube.com/watch?v=0peKz7XjEdw&feature

 

I need to be able to sort the Fiscal Month, starting with fiscal month number 1 but the last step is to Sort by Column which throws the error. Any ideas? or alternative methods?  

 

sortbyerror.PNG

 

Date table:

Date = 
GENERATE(
    CALENDARAUTO(),
    VAR YYYY = 
        YEAR ([Date])
    VAR MMMM =
        MONTH ([Date])
    RETURN
        ROW (
            "Year", CONCATENATE("CY ", YYYY),
            "Month", FORMAT([Date], "mmmm"),
            "Month Number", MMMM,
            "Fiscal Year", CONCATENATE("FY ", IF (MMMM <= 6, YYYY - 1, YYYY))
        )
 )    

Fiscal Month Number:

Fiscal Month Number = 
    IF (
        'Date'[Month Number] <= 6,
        'Date'[Month Number] + 6,
        'Date'[Month Number] - 6
    )

 Fiscal Month: 

Fiscal Month = 'Date'[Month]

 

datetable.PNG

fiscal_sort.PNG

1 ACCEPTED SOLUTION

Hi  @Anonymous ,

 

As tested here,I didnt find the same issue.Have you selected "Fiscal Month" then choosed to sort by "Fiscal Month number"?

Screenshot 2020-10-27 153647.png

Is below order what you want?

Screenshot 2020-10-27 153752.png

According to your method,it works fine here,you may check my sample .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , not very clear with your screenshoot. But make sure both fiscal month year and fiscal month year sort are coming from the same base column, they should not create each other

 

You can get any fiscal month calendar from here - https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441

 

or refer to my video :https://www.youtube.com/watch?v=w4U6Bi_fPek

Anonymous
Not applicable

Hello,

 

Thanks for the reply! I'm not sure what you mean by the same base column? 

Hi  @Anonymous ,

 

As tested here,I didnt find the same issue.Have you selected "Fiscal Month" then choosed to sort by "Fiscal Month number"?

Screenshot 2020-10-27 153647.png

Is below order what you want?

Screenshot 2020-10-27 153752.png

According to your method,it works fine here,you may check my sample .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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