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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
RoHa
Frequent Visitor

KPI visual does not accumulate

Hi all,

I have an ongoing issue with my KPI visual:

I have two tables, one called "ANT - Income Statement" and the other is called "ANT - Budget". The date bridge table between these two is called "ANT - Date". "ANT - Budget" has the columns "Sales Budget" and "MonthName". I have already linked the columns "Month Name" and "MonthName" to "Month" in "ANT - Date" via a many-to-many relationship. The slicer has the column "Month" of table "ANT - Date" as field.


What I want is the following:

I have a KPI visual and want to include a measure for sales budget as the target number. This measure should accumulate the sales budget as per the selected months in the slicer. For example, if I select January and February, the KPI should show the accumulated budget for these two months as the target number. If I select January, February and May, the KPI visual should show the accumulated budget for these three months as the target number and so on..


What happens:
When I include the below code, it only shows the budget for the most recent month when I select multiple months. Hence, it does not accumulate.

Accumulated Sales Budget =
VAR SelectedMonths = VALUES('ANT - Date'[Month])
RETURN
    CALCULATE(
        SUM('ANT - Budget'[Sales Budget]),
        TREATAS(SelectedMonths, 'ANT - Date'[Month])
    )



Can you please help!?

Greetz,

Robin.



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RoHa ,

 

Please try:

 

Here's the example data I created:

Date

Sales Budget

MonthName

2024-01-01

100

January

2024-02-01

100

February

2024-03-01

100

March

2024-04-01

100

April

2024-05-01

100

May

2024-06-01

100

June

2024-07-01

100

July

 

Create a Measure:

Accumulated Sales Budget = 
VAR SelectedMonths = VALUES('ANT - Date'[Month])
RETURN
    IF(
        ISFILTERED('ANT - Date'[Month]),
        CALCULATE(
        SUM('ANT - Budget'[Sales Budget]),
        'ANT - Budget'[MonthName] in SelectedMonths
    ),
    0)

 

The final page visualization is shown below:

vhuijieymsft_0-1718764242015.png

 

I would be grateful if you could provide me with the pbix file or sample data.

 

Remember to remove sensitive data and do not log in to your account in Power BI Desktop when uploading the pbix file.

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @RoHa ,

 

Please try:

 

Here's the example data I created:

Date

Sales Budget

MonthName

2024-01-01

100

January

2024-02-01

100

February

2024-03-01

100

March

2024-04-01

100

April

2024-05-01

100

May

2024-06-01

100

June

2024-07-01

100

July

 

Create a Measure:

Accumulated Sales Budget = 
VAR SelectedMonths = VALUES('ANT - Date'[Month])
RETURN
    IF(
        ISFILTERED('ANT - Date'[Month]),
        CALCULATE(
        SUM('ANT - Budget'[Sales Budget]),
        'ANT - Budget'[MonthName] in SelectedMonths
    ),
    0)

 

The final page visualization is shown below:

vhuijieymsft_0-1718764242015.png

 

I would be grateful if you could provide me with the pbix file or sample data.

 

Remember to remove sensitive data and do not log in to your account in Power BI Desktop when uploading the pbix file.

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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