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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
third_hicana
Helper IV
Helper IV

Sort Column Chart (Circular Dependency Error)

Hi All,

 

Asking for your help. I have a date column in my table named Project Completion Date. I created a calculated column to extract the year referencing the  Project Completion Date column using this DAX.

 
Project_Completion_Date(YYYY) =
FORMAT(FY25_PB_Master_Data[Project Completion Date],"yyyy")


I wanted to sort my column chart by calculated year. I tried sorting it using another calculated column with the Dax expression below. However, it says that there is a circular dependency error that's why it was not sorted. Appreciate your help. Thank you.

 

 

CompletionYearOrder =
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2023", 1,
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2024", 2,
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2025", 3,
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2026", 4,
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2027", 5,
IF(FY25_PB_Master_Data[Project_Completion_Date(YYYY)] = "2028", 6
))))))

 

 

third_hicana_0-1705995255707.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @third_hicana 

You just need to use year() function to extract the year, it will return the value with number type, then put the column to the x-axis, it will order automatically.

 

Project_Completion_Date(YYYY) =
YEAR ( FY25_PB_Master_Data[Project Completion Date] )

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @third_hicana 

You just need to use year() function to extract the year, it will return the value with number type, then put the column to the x-axis, it will order automatically.

 

Project_Completion_Date(YYYY) =
YEAR ( FY25_PB_Master_Data[Project Completion Date] )

 

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.

 

Idrissshatila
Super User
Super User

Hello @third_hicana ,

 

create this as a custom column in power query 

Project_Completion_Date(YYYY) =
FORMAT(FY25_PB_Master_Data[Project Completion Date],"yyyy")
 
and then the second column you're creating should work normlly


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi @Idrissshatila 

 

I got this error when I created another column in the Custom Column in Power Query

third_hicana_0-1706004369442.png

 

@third_hicana ,

 

yes , you can't copy paste the dax measure in power query since they're two different measures.

 

so check it here to know how to extract the year from the date column.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




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.