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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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/

Apologies, try again.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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