Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fjcampos
Frequent Visitor

Problem in calculating the difference from the previous month

I am calculating the difference of one month with last month, I tried this solution but it shows me the following:

cuadro_RRC.PNG
Using this formula always results in zero for me MOV_NETO_RRC
I would like to filter from January to April and only show me the values enclosed with blue.

The expected result is something like this:

 

cuadro esperadoRRC.PNG

Take into account that to calculate the month of January you must subtract the month of December.
My applied measure is as follows:

MOV_NETO_RRC = SUM(RRC[RESERVA_RIESGO_CURSO]) - CALCULATE(SUM(RRC[RESERVA_RIESGO_CURSO]);PARALLELPERIOD(DIM_TIEMPO[FECHA].[Date];-1;MONTH))

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi @fjcampos ,

 

You may create measure like DAX below.

 

 

MOV_NETO_RRC =
SUM ( RRC[RESERVA_RIESGO_CURSO] )
    - CALCULATE (
        SUM ( RRC[RESERVA_RIESGO_CURSO] ),
        DATEADD ( DIM_TIEMPO[FECHA].[Date], -1, MONTH )
    )

 

 

Best Regards,

Amy

 

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

Thank you @v-xicai  for your answer, but the result is the same.

Hi @fjcampos ,

 

You may change the formula like DAX below.

 

MOV_NETO_RRC = IF(SUM(RRC[RESERVA_RIESGO_CURSO])=BLANK(), BLANK(), SUM(RRC[RESERVA_RIESGO_CURSO]) - CALCULATE(SUM(RRC[RESERVA_RIESGO_CURSO]);PARALLELPERIOD(DIM_TIEMPO[FECHA].[Date];-1;MONTH)))

 

If the total row is incorrect, you may create another measure except the original [MOV_NETO_RRC ] using HASONEVALUE function, and display the new measure in the Matrix visual. See the similar case .

 

If I misunderstood it, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

Community Support Team _ Amy

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

Dear @v-xicai  I shared an example of my data. Can you help me solve the problem?

Thanks for your answer @v-xicai .

I attach an example file of how is my model Pbix

With your measurement I don't get a total result.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.