Forum Discussion

zelira's avatar
zelira
Frequent Visitor
2 years ago

Help with projection

Good morning friends, it's a pretty simple problem but I've been racking my brain over it for a while and haven't had any results.

So, the idea of ​​the spreadsheet is that we have a column with results, for the days that I have results (which appear as the "SomadaReceita"), and on the days that I don't have results (in the same column), the projection is printed.  The search is done in lookupvalue, where it searches the comparativo table for the s&a projection, and returns the result according to the date in dataproj. Briefly explaining the dataproj, it is in my native language but it is the ID of the day, if it is the first Monday of the month it prints 1 MONDAY, if it is the first Tuesday it prints 1 TUESDAY, and so on for all days and all their occurrences in the month.

Having explained the spreadsheet, the problem that occurs is that I have to create this column with results for several products, and this ends up generating a circular relationship that I cannot solve nor do I have a different idea of ​​how to layout this data, can you help me?

The code im using for get the results of projection

Comparando =

VAR SomadaReceita = [S&A_SomadaReceita]
VAR ProjComparativo = LOOKUPVALUE(comparativo[proj_s&a], comparativo[COMPARATIVO], RELATED('Calendário'[COMPARATIVO]))
RETURN
IF(
SomadaReceita <> 0,
SomadaReceita,
(ProjComparativo * [S&A_Desvio])*-1
)

The "RELATED" function leaves the table with a circular relationship, if I could remove this function and add another one, which would allow me to replicate the same code with other projections, since I have other products besides S&A (like EP, that you can see on print) it would be perfect.

 

 

 



2 Replies