cancel
Showing results for
Did you mean:
Regular Visitor

## Comparing data between two different Month

Hallo,

in need help to modify this measure:

``````1. Trend Crediti =
CALCULATE (
SUM ( SYS_CREDEB_PARTITAC[ZZ. Residuo]  );
FILTER (
ALLEXCEPT( SYS_CREDEB_PARTITAC;SYS_CREDEB_PARTITAC[ZZ. Residuo];SYS_CREDEB_PARTITAC[Codice_Cliente]; SYS_CREDEB_PARTITAC[Codice_Agente_Ven] );
AND(SYS_CREDEB_PARTITAC[Data_Fattura] <= MAX ( 'Time'[Fine Mese] );SYS_CREDEB_PARTITAC[Incassata] = FALSE ()
)
)
)
+
CALCULATE (
SUM ( SYS_CREDEB_PARTITAC[Importo_Incassato]  );
FILTER (
ALLEXCEPT(  SYS_CREDEB_PARTITAC;SYS_CREDEB_PARTITAC[Importo_Incassato];SYS_CREDEB_PARTITAC[Codice_Cliente]; SYS_CREDEB_PARTITAC[Codice_Agente_Ven] );
AND(
AND(SYS_CREDEB_PARTITAC[Data_Pagamento] > MAX ( 'Time'[Fine Mese] );SYS_CREDEB_PARTITAC[Data_Fattura] <= MAX('Time'[Fine Mese])
); SYS_CREDEB_PARTITAC[Incassata] = TRUE ()
)

)
)``````

i would like to compare the resoult of this measure between two different month.

for example:

 Cliente Trend Crediti 3 Month Ago Trend Crediti 1 Month Ago Percentage difference 001 150.000 100.000 -33,33% 002 130.000 140.000 7,69% 003 120.000 120.000 0,00%

So, i think i have to create two different measure one that give me the sum at the end of the previous month (ex. 10.31.2019), and the second one that gives me the sum at the end of 3 month ago (ex. 07.31.2019) before today.

someone could help me?

thank you so much,

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team

## Re: Comparing data between two different Month

I would suggest you convert Trend Crediti to calculate column or create another calculate column using the same formula, then create a measure like pattern below to achieve the increase rate each month:

``````Diff =
VAR Current_Month =
YEAR ( Table[end of the month] )
VAR Current_Month_total =
CALCULATE (
SUM ( Table[Trend Crediti] ),
FILTER ( Table, Table[end of the month] = Current_Month )
)
VAR Previous_Month = Current_Month - 1
VAR Previous_Month_Total =
CALCULATE (
SUM ( Table[Trend Crediti] ),
FILTER ( Table, Table[end of the month] = Previous_Month )
)
RETURN
( Current_Month_total - Previous_Month_Total ) / Previous_Month_Total
``````

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support Team

## Re: Comparing data between two different Month

I'm confused on your requirement. Could you please share some sample data and give expected result?

Regards,

Jimmy Tao

Regular Visitor

## Re: Comparing data between two different Month

hello @v-yuta-msft ,

the measure was sugged in this post:

https://community.powerbi.com/t5/Desktop/Sum-Value-at-the-end-of-the-month/m-p/712715#M344009

with this measure i have the result at the end of the month.

 1. Trend Crediti end of the month €      5.401.350,00 31/01/2019 €      5.993.730,00 28/02/2019 €      6.702.127,00 31/03/2019 €      7.426.816,00 30/04/2019 €      7.648.569,00 31/05/2019 €      7.637.658,00 30/06/2019 €      7.817.646,00 31/07/2019 €      7.506.633,00 31/08/2019 €      7.236.531,00 30/09/2019 €      7.089.035,00 31/10/2019 €      6.960.956,00 30/11/2019 €      6.960.956,00 31/12/2019

now I want to calculate the difference by two diffenent month. and I dont know if i have to start from this measure and create anther one o start to zero.

the result expected is:

 Fine Mese 31/01/2019 28/02/2019 Difference 1. Trend Crediti €   5.401.350,00 €   5.993.730,00 10%

i don't know if i am clear.

Regards

Highlighted
Community Support Team

## Re: Comparing data between two different Month

I would suggest you convert Trend Crediti to calculate column or create another calculate column using the same formula, then create a measure like pattern below to achieve the increase rate each month:

``````Diff =
VAR Current_Month =
YEAR ( Table[end of the month] )
VAR Current_Month_total =
CALCULATE (
SUM ( Table[Trend Crediti] ),
FILTER ( Table, Table[end of the month] = Current_Month )
)
VAR Previous_Month = Current_Month - 1
VAR Previous_Month_Total =
CALCULATE (
SUM ( Table[Trend Crediti] ),
FILTER ( Table, Table[end of the month] = Previous_Month )
)
RETURN
( Current_Month_total - Previous_Month_Total ) / Previous_Month_Total
``````

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements