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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
miikasa
Frequent Visitor

Accumulated Values in a bar chart

Hi guys,

 

I have this measure which is linked to a calendar table:

 

SalesIndex =
DIVIDE(
    [SalesAmount],
    [AverageCurrentMonthPreviousMonth],
    0
)
 
Calendar = CALENDAR(DATE(2022,01,01),TODAY())
 
Now I need to show the accumulated values by year in a bar chart, like:

AccumulatedSalesIndex2023: sum of sales index 2023
AccumulatedSalesIndex2024: sum of sales index 2024

Can anyone give me any tip on how can I do that? I tried to sum up the values and it worked, but when I put in the chart, it doesn't appear properly.

Thank you in advance.
 
1 ACCEPTED SOLUTION

Hi @miikasa 

Could you try:
Running total =
Calculate(
[SalesIndex]

Calendar[Date] <= Max(Calendar[Date]) --Filter to less than the current max
, Year(Calendar[Date]) = Year(Max(Calendar[Date])) --keep in the same year
)


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

6 REPLIES 6
SamWiseOwl
Super User
Super User

Hi @miikasa 

Have you tried the TotalYTD function?

Total YTD =
 TOTALYTD(
    [Sum of Quantity] --Measure to calculate
    ,'Calendar table'[Date] --Calendar table and date
    ,"31 Dec" --Optional end of year
 )

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Hi @SamWiseOwl,

 

Thank you for suggestion.

 

Sorry, I didn't explain clearly.

What I really need is to add a new category in the x-axis and show the accumulated measure. Now when I try to add, it just shows the values by month. Do you have any suggestion on how to do it?

Thank you again.

Hi @miikasa 

Could you make a mock up of what you have and what you want please 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Hi @SamWiseOwl.

Sure!

 

This is what I have:

miikasa_0-1723563222049.png

 

And this is what I want:

miikasa_1-1723563257230.png

 

The x-axis data I built with this formula: 

Calendar = CALENDAR(DATE(2022,01,01),TODAY())

 

And the y-axis I built with this measure: 

 
SalesIndex =
DIVIDE(
    [SalesAmount],
    [AverageCurrentMonthPreviousMonth],
    0
 
Appreciate your help. 😊

Hi @miikasa 

Could you try:
Running total =
Calculate(
[SalesIndex]

Calendar[Date] <= Max(Calendar[Date]) --Filter to less than the current max
, Year(Calendar[Date]) = Year(Max(Calendar[Date])) --keep in the same year
)


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Hi @SamWiseOwl 

 

It worked, thank you very much for your support. I appreciate it.

Warm regards.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.