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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
LeaRupnik
Helper III
Helper 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,....

 

datenumbersum 
jan11 
feb23 
mare36 
apr410 
maj515 
jun621 
jul728 
avg836 
sep945 
 45  

 

Please heal me. 

LEa

1 ACCEPTED SOLUTION
Icey
Community Support
Community 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.

mtd2.jpg

4. Create measures.

MTD = TOTALMTD(SUM('Table'[quantiti]),'Calendar'[Date])
YTD =
IF (
    NOT ( ISBLANK ( MAX ( 'Table'[quantiti] ) ) ),
    TOTALYTD ( SUM ( 'Table'[quantiti] ), 'Calendar'[Date] )
)

mtd.PNG

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.

View solution in original post

12 REPLIES 12
Icey
Community Support
Community Support

Hi @LeaRupnik ,

If you have no other questions, please accept the previously useful response as a answer.

 

Best Regards,

Icey

 

AvPowerBI
Post Patron
Post Patron

Yes I am having the same issue! Help!

help?

What problem do you have, it the bast that you give the exact excaple.

LP

Lea

can you let me know when this sorted

Icey
Community Support
Community Support

Hi @LeaRupnik ,

 

Is this problem solved?

 

Best Regards,

Icey

Anonymous
Not 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:

 

Capture.PNG

 
 
CalculatedTable = CALCULATE(SUM('Table'[values]);FILTER('Table';'Table'[monthnr]<=EARLIER('Table'[monthnr])))

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

datequantiti 
1.02.20192 
12.02.20195 
14.02.20195 
3.03.20194 
5.03.20196 
5.04.20192 
6.04.20195

 

 

and i would like to get this

feb1212
mar1022
apr729
 29 

 

thx Lea

Icey
Community Support
Community 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.

mtd2.jpg

4. Create measures.

MTD = TOTALMTD(SUM('Table'[quantiti]),'Calendar'[Date])
YTD =
IF (
    NOT ( ISBLANK ( MAX ( 'Table'[quantiti] ) ) ),
    TOTALYTD ( SUM ( 'Table'[quantiti] ), 'Calendar'[Date] )
)

mtd.PNG

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.

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

Icey
Community Support
Community Support

Hi @LeaRupnik ,

Try this:

sort.jpgsort2.PNG

Best Regards,

Icey

 

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

Hi @Icey 

 

it's work, thanke you. 

 

LEa

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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