Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
My issue regards a circular dependency I am not able to understand. Here's my relationship pattern:
In table Margine I built 2 calculated columns which I copy down here:
CNTMRG_AvailableCredits = RELATED(Contratti[CNT_Credits]) + CALCULATE(SUM('Extra crediti'[EXTCRD_Credits]) ;
FILTER('Extra crediti' ; Margine[CNTMRG_ContractId] = 'Extra crediti'[EXTCRD_ContractId] && YEAR('Extra crediti'[EXTCRD_Date]) < Margine[CNTMRG_Year] || (YEAR('Extra crediti'[EXTCRD_Date]) = Margine[CNTMRG_Year] && MONTH('Extra crediti'[EXTCRD_Date]) <= Margine[CNTMRG_Month]))) - CALCULATE(SUM(Tickets[TKT_UsedCredits]) ;
FILTER(Tickets ; Tickets[TKT_ContractId] = Margine[CNTMRG_ContractId] && (Tickets[TKT_InsertYear] < Margine[CNTMRG_Year] || (Tickets[TKT_InsertYear] = Margine[CNTMRG_Year] && Tickets[TKT_InsertMonth] <= Margine[CNTMRG_Month])) && Tickets[TKT_Type]="SRQ" && (Tickets[TKT_Solution] = "Resolved" || Tickets[TKT_Solution] = "None" || (Tickets[TKT_Solution] = "WontFix" && DISTINCTCOUNT('Attività'[ACT_Id])<>0))))
CNTMRG_Margin = Margine[CNTMRG_ContractFee] * IF(Margine[CNTMRG_Year] < YEAR(TODAY()) || (Margine[CNTMRG_Year] = YEAR(TODAY()) && Margine[CNTMRG_Month] <= MONTH(TODAY()));1;0) + CALCULATE(SUM('Extra crediti'[EXTCRD_Price]) ;
FILTER('Extra crediti' ; YEAR('Extra crediti'[EXTCRD_Date]) = Margine[CNTMRG_Year] && MONTH('Extra crediti'[EXTCRD_Date]) = Margine[CNTMRG_Month])) - CALCULATE(SUM(Tickets[TKT_OreTotaliAttività]) * 35 ;
FILTER(Tickets ; Margine[CNTMRG_ContractId] = Tickets[TKT_ContractId] && Tickets[TKT_InsertYear] = Margine[CNTMRG_Year] && Tickets[TKT_InsertMonth] = Margine[CNTMRG_Month] && Tickets[TKT_Type] = "SRQ" && (Tickets[TKT_Solution] = "Resolved" || Tickets[TKT_Solution] = "None" || (Tickets[TKT_Solution] = "WontFix" && DISTINCTCOUNT('Attività'[ACT_Id])<>0))))
@Anonymous,
This happens when you have context transition happens in your calculated column, and your table that contains the calculated column does not have a primary key. You can look at this article to have a better understanding of circular dependency.
@Anonymous,
Since you have context transition (using CALCULATE) in the two calculated columns of the many side of the relationship, calculated column 1 depends on all the columns in the Margin table + calculated column 2. Same thing happens to calculated column, where it depends on all the columns in the Margin + calculated column 1. This leads to circular dependency that explains in the article.
@Anonymous
Thanks for answering. Unfortunately I already read it, I understand what circular dependency means, but I don't find out why it affects my situation. I am not able to detect where it takes me.
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |