Forum Discussion
Anonymous
4 years agoNot applicable
calculate current month vs previous month
Hi, I need some help on this, I'm pretty new to PBI. I have a list of meter readings and I want to automatically calculate the usages in each month. The list will be updated on monthly basis...
- 4 years ago
Anonymous Yes! So now you can do this:
Usage Column = VAR __CurrentValue = [Value] VAR __Meter = [Attribute] VAR __Date = [Datum meteropname] VAR __PreviosDate = MAXX(FILTER('Table',[Datum meteropname]<__Date && [Attribute]=__Meter),[Datum meteropname]) VAR __PreviousValue = MAXX(FILTER('Table',[Datum meteropname]=__PreviousDate && [Attribute]=__Meter),[Value]) RETURN __CurrentValue - __PreviousValue
Anonymous
4 years agoNot applicable
Hi Greg,
Thanks for the reply and info in order to help me with this headache...
Here is the sample data:
| Date of meter reading | Meter A | Meter B | Meter C |
| 1-12-2020 | 687,244 | 43,924 | 5,514 |
| 1-1-2021 | 690,673 | 45,316 | 5,514 |
| 1-2-2021 | 694,075 | 46,669 | 5,514 |
| 1-3-2021 | 697,137 | 47,880 | 5,514 |
| 1-4-2021 | 700,811 | 49,323 | 5,514 |
| 1-5-2021 | 704,111 | 50,692 | 5,514 |
| 1-6-2021 | 707,722 | 52,182 | 5,514 |
| 1-7-2021 | 710,665 | 53,268 | 5,514 |
| 1-8-2021 | 712,798 | 53,906 | 5,514 |
| 1-9-2021 | 714,859 | 54,489 | 5,514 |
| 1-10-2021 | |||
| 1-11-2021 |
What I want is the calculate the difference between 1-12-2020 vs 1-1-2021, 1-2-2021 vs 1-3-2021, etc.. for Meter A, B, and C
So I can make a bar chart which displays the usage per month per meter.
Thanks,
Erwin
Greg_Deckler
Community Champion
4 years agoAnonymous See Page 9 of attached PBIX below sig.