Sum values in a details view used to search specific economics data.

Hello to everyone,

if in this details view(1), in the field “partner” there is the value ATS,

I would sum the field “importo rendicontabile” where the field “progetto” is equal to the field in the first details view(1) and “period” is equal to the selected and filed “voce di costo” is equal to “d. Costi per servizi di consulenza”

I used this formula but it doesn’t works:

IF([Partner]<>“ATS”,
SUM(
SELECT(ALTRICOSTIReS[Importo rendicontabile],
AND ([Periodo]>=[DA],[Periodo]<=[A], [Partner]=[_THISROW].[Partner], [Progetto]=[_THISROW].[Progetto], [Voce di costo]=“b. Costi relativi a strumentazioni e attrezzature” )
)),
SUM(
SELECT(ALTRICOSTIReS[Importo rendicontabile],[Progetto]=[_THISROW].[Progetto] ))
)

Someone can help me? tks

This is a simple matter of troubleshooting. Reduce your expression to a trivial case:

SELECT(
  ALTRICOSTIReS[Importo rendicontabile],
  [Progetto]=[_THISROW].[Progetto]
)

Does that produce the expected results? If no, fix it. If yes, expand:

SELECT(
  ALTRICOSTIReS[Importo rendicontabile],
  AND(
    [Partner]=[_THISROW].[Partner],
    [Progetto]=[_THISROW].[Progetto]
  )
)

Expected result? No: fix. Yes: expand:

SELECT(
  ALTRICOSTIReS[Importo rendicontabile],
  AND(
    [Periodo]<=[_THISROW].[A],
    [Partner]=[_THISROW].[Partner],
    [Progetto]=[_THISROW].[Progetto]
  )
)

Continue until you find the problem.

1 Like

In order to help other people, i solved with this expression:

IFS(
AND([Partner]<>“ATS”, ISNOTBLANK([Progetto]),ISNOTBLANK([Partner]),ISNOTBLANK([DA]),ISNOTBLANK([A])),
SUM(
SELECT(PERSONALEReS[Costo],
AND ([Periodo]>=[DA],[Periodo]<=[A], [Partner]=[_THISROW].[Partner], [Progetto]=[_THISROW].[Progetto] )
)),
[Partner]=“ATS”,
SUM(
SELECT(PERSONALEReS[Costo],
AND([Periodo]>=[DA],[Periodo]<=[A], [Progetto]=[_THISROW].[Progetto] ))))

1 Like