Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone, thank you very much for your time and attention.
I need your help with the following, to be able to obtain the amount of the previous week from my data.
I got the amount of the current week, like this:
and I thought that with the following calculated column, I would get the value of the previous week:
in order to calculate the variation between the current week and the previous week.
Thanks for the help.
Solved! Go to Solution.
@carlosmorales solution attached, hope that is what you are looking for
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @carlosmorales ,
Try the following code:
SemAnt = CALCULATE ( MAX ( 'CXC Detalle'[semactual] ); FILTER ( 'CXC Detalle'; 'CXC Detalle'[semana] = EARLIER ( 'CXC Detalle'[semana] ) - 1 ); 'CXC Detalle'[Cliente] = EARLIER ( 'CXC Detalle'[Cliente] ); 'CXC Detalle'[Rangos Vencimiento] = EARLIER ( 'CXC Detalle'[Rangos Vencimiento] ) )
PBIX file attach.
Although I must advise that looking at the data you have you should make measures and not calculated columns since this will add size to your model. Using calculated measure that will alow more flexebility in the use of the data:
Monto = SUM('CXC Detalle'[Monto USD]) Previous week Monto = CALCULATE ( SUM ( 'CXC Detalle'[Monto USD] ); FILTER ( ALL ( 'CXC Detalle'[semana] ); 'CXC Detalle'[semana] = MAX ( 'CXC Detalle'[semana] ) - 1 ) ) Variation = [Monto] - [Previous week Monto]
Be aware that the previous week need to be adjust in case you have more than 1 year on your data but it's similar to what is written.
As you can see on the file using measure the result is the same.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @carlosmorales ,
Try the following code:
SemAnt = CALCULATE ( MAX ( 'CXC Detalle'[semactual] ); FILTER ( 'CXC Detalle'; 'CXC Detalle'[semana] = EARLIER ( 'CXC Detalle'[semana] ) - 1 ); 'CXC Detalle'[Cliente] = EARLIER ( 'CXC Detalle'[Cliente] ); 'CXC Detalle'[Rangos Vencimiento] = EARLIER ( 'CXC Detalle'[Rangos Vencimiento] ) )
PBIX file attach.
Although I must advise that looking at the data you have you should make measures and not calculated columns since this will add size to your model. Using calculated measure that will alow more flexebility in the use of the data:
Monto = SUM('CXC Detalle'[Monto USD]) Previous week Monto = CALCULATE ( SUM ( 'CXC Detalle'[Monto USD] ); FILTER ( ALL ( 'CXC Detalle'[semana] ); 'CXC Detalle'[semana] = MAX ( 'CXC Detalle'[semana] ) - 1 ) ) Variation = [Monto] - [Previous week Monto]
Be aware that the previous week need to be adjust in case you have more than 1 year on your data but it's similar to what is written.
As you can see on the file using measure the result is the same.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@carlosmorales solution attached, hope that is what you are looking for
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
103 | |
91 | |
79 | |
72 | |
68 |
User | Count |
---|---|
108 | |
96 | |
95 | |
73 | |
71 |