cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nannimora Regular Visitor
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 AgoTrend Crediti 1 Month AgoPercentage difference
001150.000100.000-33,33%
002130.000140.0007,69%
003120.000120.0000,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
Community Support Team

Re: Comparing data between two different Month

@nannimora ,

 

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.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Comparing data between two different Month

@nannimora ,

 

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

 

Regards,

Jimmy Tao

nannimora Regular Visitor
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,0031/01/2019
 €      5.993.730,0028/02/2019
 €      6.702.127,0031/03/2019
 €      7.426.816,0030/04/2019
 €      7.648.569,0031/05/2019
 €      7.637.658,0030/06/2019
 €      7.817.646,0031/07/2019
 €      7.506.633,0031/08/2019
 €      7.236.531,0030/09/2019
 €      7.089.035,0031/10/2019
 €      6.960.956,0030/11/2019
 €      6.960.956,0031/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 Mese31/01/201928/02/2019Difference
 1. Trend Crediti  €   5.401.350,00 €   5.993.730,0010%

 

i don't know if i am clear.

 

Regards

 

Highlighted
Community Support Team
Community Support Team

Re: Comparing data between two different Month

@nannimora ,

 

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.

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors