Forum Discussion
Cumulative value with Userelationship
- 5 years ago
Hi guys,
I have solved the problem.
The measure I need to introduce is:
Pendiente de cobro =Var Facturado = CALCULATE(SUM('T_FACTURACIONEXPEDIENTERESUMIDA'[TOTALAPAGAR]);'T_FACTURACIONEXPEDIENTERESUMIDA'[DIASSINCOBRAR]>0;USERELATIONSHIP(T_CALENDARIO[Fecha];'T_FACTURACIONEXPEDIENTERESUMIDA'[FECHAFACTURA]);FILTER(ALL(T_CALENDARIO[Fecha]);T_CALENDARIO[Fecha]<=MAX(T_CALENDARIO[Fecha])))Var Cobrado = CALCULATE(SUM('T_FACTURACIONEXPEDIENTERESUMIDA'[ENTRADA]);'T_FACTURACIONEXPEDIENTERESUMIDA'[DIASSINCOBRAR]>0;USERELATIONSHIP(T_CALENDARIO[Fecha];'T_FACTURACIONEXPEDIENTERESUMIDA'[FECHAFACTURA]);FILTER(ALL(T_CALENDARIO[Fecha]);T_CALENDARIO[Fecha]<=MAX(T_CALENDARIO[Fecha])))Var PendienteCobro = Facturado-CobradoReturnPendienteCobro
Hi @VijayP
Thank you for your answer but it does not work as I expected.
I made some changes:
1. Put the relationship as inactive because I need to have it like this.
2. Create a new measure called 'Test 4' which gives the following results:
The result for 2019 is working correctly, but it is not the case for 2017 and 2018, because the results should be the following ones:
I think the problem is that the measure is not applying correctly the maximum date for each year (the part I put in bold):
The link to the file is https://www.dropbox.com/s/kip4r60nztzkzmc/Prueba%20Power%20BI.pbix?dl=0
Thanks in advance
Regards
Hi guys,
I have solved the problem.
The measure I need to introduce is: