Forum Discussion
carinatina_pbi
4 years agoFrequent Visitor
Calculate delta between 2 rows and multiply by another cell
Dear all, I am trying to replicate this table below in PBI, in order to get the last 2 reds columns (S and T): I could calculate the deltas columns but the result is in a different line...
- 4 years ago
- 4 years ago
Hi, carinatina_pbi ;
You could create measures as follows:
Col 1 = MAX('Ticket'[Amount])*CALCULATE(MAX('Exchange rate'[Delta 1]),FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),1)))Col 2 = MAX('Ticket'[Amount])*CALCULATE(MAX('Exchange rate'[Delta 2]),FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),2)))Col 3 = MAX('Ticket'[Amount])*CALCULATE(MAX('Exchange rate'[Delta 3]),FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),3)))Col 4 = MAX('Ticket'[Amount])*CALCULATE(MAX('Exchange rate'[Delta 4]),FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),4)))Col 4 = MAX('Ticket'[Amount])*CALCULATE(MAX('Exchange rate'[Delta 4]),FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),4)))total sum = MAXX(FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-1)),[Col 1])+MAXX(FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-2)),[Col 2])+MAXX(FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-3)),[Col 3])+MAXX(FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-4)),[Col 4])+MAXX(FILTER(ALL('Ticket'),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-5)),[Col 5])Real Dif.Monthly = [Monthly Diff.]-([total sum]-SUMX(FILTER(ALL(Ticket),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-1)),[total sum]))Real Dif.Monthly = [Monthly Diff.]-([total sum]-SUMX(FILTER(ALL(Ticket),EOMONTH([Period Month],0)=EOMONTH(MAX('Ticket'[Period Month]),-1)),[total sum]))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
parry2k
Super User
4 years agocarinatina_pbi Indeed, that should be an easy fix since the core of logic is in place. I will take a look when I get a chance.