Forum Discussion
sum column
Hello,
a have a problem, how to sum the sum column.
i have a exemple, a wont a sum column sum witch is sum jan in feb and a get 1+2 = 3 then 3+3 = 6 then 6+4 = 10,....
| date | number | sum | |
| jan | 1 | 1 | |
| feb | 2 | 3 | |
| mare | 3 | 6 | |
| apr | 4 | 10 | |
| maj | 5 | 15 | |
| jun | 6 | 21 | |
| jul | 7 | 28 | |
| avg | 8 | 36 | |
| sep | 9 | 45 | |
| 45 |
Please heal me.
LEa
Hi LeaRupnik ,
Try this:
1. Create a Calendar table.
Calendar = CALENDAR ( DATE ( 2019, 1, 1 ), DATE ( 2019, 12, 31 ) )2. Create columns in Calendar table.
Month = MONTH('Calendar'[Date])Month Name = FORMAT('Calendar'[Date],"mmm")3. Create relationship.
4. Create measures.
MTD = TOTALMTD(SUM('Table'[quantiti]),'Calendar'[Date])YTD = IF ( NOT ( ISBLANK ( MAX ( 'Table'[quantiti] ) ) ), TOTALYTD ( SUM ( 'Table'[quantiti] ), 'Calendar'[Date] ) )PBIX file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
12 Replies
- AnonymousNot applicable
Because there is no logical way to sort just the names of each month, this isn't possible. But add a date or the monthnumber (1-12) to your table and it is possible.
If you have the possibility to add a column with the number of each month or a column with a date you can use:
CalculatedTable = CALCULATE(SUM('Table'[values]);FILTER('Table';'Table'[monthnr]<=EARLIER('Table'[monthnr])))- LeaRupnikHelper III
Hello,
this is work, but i have a table more complicated.
I have quantity according to date, then i have to sum a quantity to month, then to each month together.
ia have that kind of problem
date quantiti 1.02.2019 2 12.02.2019 5 14.02.2019 5 3.03.2019 4 5.03.2019 6 5.04.2019 2 6.04.2019 5 and i would like to get this
feb 12 12 mar 10 22 apr 7 29 29 thx Lea
- IceyCommunity Support
Hi LeaRupnik ,
Try this:
1. Create a Calendar table.
Calendar = CALENDAR ( DATE ( 2019, 1, 1 ), DATE ( 2019, 12, 31 ) )2. Create columns in Calendar table.
Month = MONTH('Calendar'[Date])Month Name = FORMAT('Calendar'[Date],"mmm")3. Create relationship.
4. Create measures.
MTD = TOTALMTD(SUM('Table'[quantiti]),'Calendar'[Date])YTD = IF ( NOT ( ISBLANK ( MAX ( 'Table'[quantiti] ) ) ), TOTALYTD ( SUM ( 'Table'[quantiti] ), 'Calendar'[Date] ) )PBIX file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- IceyCommunity Support
- AvPowerBIPost Patron
Yes I am having the same issue! Help!
- algernon_crumpNew Member
help?
- pbi_iaNew Member
can you let me know when this sorted