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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
StephenF
Responsive Resident
Responsive Resident

Circular dependency in a rankx

I'm trying to get a column to rank spend against 2 categories eg, whats 1,2,3 in spend for say Motors or something.

 

I'm getting a wierd cicular dependency error.

 

I've attached a small pbix with the data table and my attempt at it if you can have a stab at it please.

 

Data/PBIX is behind this link here.

 

Other We transfer link if that doesnt work.

 

 

 

 

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @StephenF ,

Here are the steps you can follow:

1. Create calculated column.

Rank 4 =
RANKX(FILTER(ALL(Spends),'Spends'[Major Category]=EARLIER('Spends'[Major Category])&&'Spends'[Parent Client]=EARLIER('Spends'[Parent Client])),[InvSpend],,DESC)

2. Result:

vyangliumsft_0-1652750140744.png

 

Best Regards,

Liu Yang

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

This ranks across three categories. I wish to rank across two - category and client and be able to filter on year which would change the result dynamically.

I do not think this is possible with a calculated column as per your example as the results are static.

 

StephenF
Responsive Resident
Responsive Resident

@amitchandak Can you take a look, ive corrected the links address by adding a second.

amitchandak
Super User
Super User

@StephenF , it is showing the file is deleted , please share again

 

refer : https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Apologies, try again.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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