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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Cumulative Sum Table

Greetings colleagues,
I'm new to power BI, I'm doing the mundanza from excel to power bi and I ran into a problem.
I have data of this style

educocone_0-1715450524010.png

And I want to want a board or matrix with this style

educocone_1-1715450556073.png

I was thinking of just using some auxiliary table month.year and an id, but I still can't land the idea, even so I think it can be done easier, but I don't find how.


If you could support me, I would be infinitely grateful

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

It seems to me that I have the solution, although there is always room for improvement, I share the file with you.

educocone_0-1715744720494.png

As I said at the beginning, I managed to do it with a row_number as an id, I still don't know if it's the best solotion, but it seems to funionize.

Thank you very much in advance for the help and I hope you can be helpful.

This type of table is very useful if you want to create time series with the maturation of different years.

educocone_1-1715744997355.png

I look forward to hearing from you.

Thank you very much in advance.

View solution in original post

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

It seems to me that I have the solution, although there is always room for improvement, I share the file with you.

educocone_0-1715744720494.png

As I said at the beginning, I managed to do it with a row_number as an id, I still don't know if it's the best solotion, but it seems to funionize.

Thank you very much in advance for the help and I hope you can be helpful.

This type of table is very useful if you want to create time series with the maturation of different years.

educocone_1-1715744997355.png

I look forward to hearing from you.

Thank you very much in advance.

DataNinja777
Super User
Super User

Hi @Syndicate_Admin ,

I've prepared your required output for 2023 which includes 5 months of 2024, but putting 2024 month 01 to 05 side by side will require some effort, as it is duplicate information of periods 13 - 17 in 2023, and inbuilt Power BI relationship logic prevents duplicate counting by ensuring many to one relationship and do not recomment many to many relationship, presicely for this reason of preventing duplicate counting.  I attach pbix file for your reference.  

DataNinja777_0-1715561667710.png

Best regards,

 

 

DataNinja777
Super User
Super User

Hi @Syndicate_Admin ,

The standard approach in Power BI is as provided by @Ashish_Mathur which involves creating a calendar table and leveraging the time intelligence function available in DAX. 

Regarding your example provided, I am wondering why your "mes" (month I suppose) is running up to 14 instead of 12. Is this intentional or it was not intended? If it runs up to 14 like posting period in SAP, you may need to create a summarized table of that to create one to many relationship with your fact table if you want to analyse by mes of up to 14 instead of 12.

Best regards,

It was placed intentionally, since what I want is to see "matured" data by year, so if I am going to analyze 3 years I would have, for 2022, I would have (12+12+5) periods, for 2023 (12+5) periods and for 2024 5 periods (corresponding to the month of May), this in order to have the data in a nuance and then perform time series analysis by matured year.
Do you have any posts about summary tables that you mention or something similar?
Thanks!
Best regards

Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table.  To your matrix visual, drag Month name to the row labels and year to the column labels.  Write these measures

Measure = sum(Data[Amount])

YTD = calculate([Measure],datesytd(calendar[date],"31/12"))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@Syndicate_Admin Add an Index column in Power Query Editor and Year column YEAR([fecha]) as DAX in the Desktop. Then a running total measure: Better Running Total - Microsoft Fabric Community


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.