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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
corporate
Helper I
Helper I

Interactive Sum and Variation by Filter

Hi everyone,

I import this table in Powe BI:

table.png

I create several filters on the page: Month, Target, Region... and I want that, when the user select a Month from the filter, Power BI calculates the sum of Contactability per Month and the difference of these sums between the selected Month and all other Months, and I can show these difference on an histogram.

For example, if the user select Month '201901' I want the histogram to show:

histogram.png

And, of course, the histogram should react to other filters (Target, Region...).

Does anyone know how I can achieve this?

 

Thank you very much!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @corporate ,

 

Please check:

 

1. Create a table.

Month = VALUES('Table'[Month])

month.PNG 

 

2. Create a measure.

Difference = 
VAR SelectedMonth =
    SELECTEDVALUE ( 'Table'[Month] )
VAR ThisMonth =
    MAX ( 'Month'[Month] )
VAR SelectedMonthValue =
    CALCULATE ( SUM ( 'Table'[Contactability] ), 'Month'[Month] = SelectedMonth )
VAR ThisMonthValue =
    CALCULATE ( SUM ( 'Table'[Contactability] ), 'Table'[Month] = ThisMonth )
RETURN
    ThisMonthValue - SelectedMonthValue

 

3. Create a Clustered column chart and all slicers from 'Table'.

bar.PNG

 

4. Test.

MONTH.gif

 

For more details, please check the attached PBIX file.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @corporate ,

 

Please check:

 

1. Create a table.

Month = VALUES('Table'[Month])

month.PNG 

 

2. Create a measure.

Difference = 
VAR SelectedMonth =
    SELECTEDVALUE ( 'Table'[Month] )
VAR ThisMonth =
    MAX ( 'Month'[Month] )
VAR SelectedMonthValue =
    CALCULATE ( SUM ( 'Table'[Contactability] ), 'Month'[Month] = SelectedMonth )
VAR ThisMonthValue =
    CALCULATE ( SUM ( 'Table'[Contactability] ), 'Table'[Month] = ThisMonth )
RETURN
    ThisMonthValue - SelectedMonthValue

 

3. Create a Clustered column chart and all slicers from 'Table'.

bar.PNG

 

4. Test.

MONTH.gif

 

For more details, please check the attached PBIX file.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much @Icey !

 

It works and solved my problem.

 

Thank you, again.

 

Valentina

nandukrishnavs
Community Champion
Community Champion

@corporate  - can you provide a sample dataset/pbix file?


Regards,
Nandu Krishna

@nandukrishnavs unfortunately I can't upload a pbix file and my company doesn't allow me to share a Dropbox or Drive link.

I post here a dataset sample:

MonthTargetRegion Contactability
201911ResidentialLombardia5
201911ResidentialLazio1
201911Micro BusinessLombardia1
201912Micro BusinessPiemonte6
201912ResidentialLazio4
201912ResidentialLombardia3
201912Micro BusinessPiemonte1
201912Micro BusinessLazio2
202001Micro BusinessLombardia3
202001Micro BusinessVeneto5
202001Micro BusinessPiemonte4
202001ResidentialLombardia2
202002ResidentialLazio1
202002ResidentialPiemonte1
202002ResidentialVeneto3
202002ResidentialLombardia4
202002Micro BusinessLazio4
202002Micro BusinessPiemonte2

 

and here is how the dashboard should look like when I select Month = '201912' and Target = 'Residential':

table.png

The histogram is built with manually inserted data, because my problem is that I don't know how to automatically build it using the data in the above table. 

 

Thank you very much!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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