Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All,
Need help to fix circular dependency in order to get the final date
In calculations, need to average and then find how much time is required for completion based on last 2 months average.
Columns - Status ( there are 2 status - completed and pending) ,project, points, closingdate, work_left
[points] are at [mainkey_id] level and rolled up to project level
work_left is sum of points at [mainkey_id] level with [status] as pending
DateDim is calculatedtable having all dates and joined with closingdate from Query1
based on completed status for last 2 months we add the points per project and take an average.
[AvgWorkDone] =
IF(ISBLANK(CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 ),0,CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 )
The report has to show all data so we have data pulled for last 2 years and for computing final date we need to consider only last 2 months average.
This still works fine, but the calculated number of days are to be added in today's date so using DateAdd get circular dependency. Tried using ALLEXCEPT but nothing works..
to calculate the final date ---
CALCULATE
(
DATEADD(
Query1[DateToday],
DIVIDE(
SUM(Query1[work_left]),
CALCULATE(SUM(Query1[AvgWorkDone]),ALLEXCEPT(Query1,Query1[mainkey_id]))
,0)
,DAY)
,ALLEXCEPT(Query1,Query1[[mainkey_id])
not sure what needs to be changed or calculated differently. Any help much appreciated
Solved! Go to Solution.
If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.
Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.
If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.
Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |