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,

Schermata 2022-05-27 alle 13.13.38.png

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"

Schermata 2022-05-27 alle 13.07.10.png

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

Solved Solved
0 2 84
1 ACCEPTED SOLUTION

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] ))))

 

View solution in original post

2 REPLIES 2

Steve
Platinum 4
Platinum 4

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.

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] ))))

 

Top Labels in this Space