cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

1 ACCEPTED SOLUTION
Memorable Member

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.

6 REPLIES 6
Memorable Member

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.

Frequent Visitor

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.

Memorable Member

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.

Frequent Visitor

Hi @SamWiseOwl.

Sure!

This is what I have:

And this is what I want:

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

Memorable Member

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.

Frequent Visitor

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

Warm regards.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors