Forum Discussion
LeaRupnik
6 years agoHelper III
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 ...
- 6 years ago
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.
Icey
6 years agoCommunity 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.
LeaRupnik
6 years agoHelper III
i a new in this, in Power bi and the forum.
The solution witch post it work. Now a have a problem how to sort the short month name. I don't want the number month.
tnx
Lea