Skip to main content
cancel
Showing results for 
Search instead 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

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
Memorable Member
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.

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
Europe Fabric Conference

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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