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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
yong9lum
Frequent Visitor

Average chart values based on on-page filters

I want my column chart to be able to show average values based on the period that I filter, eg. if I multi-select JANUARY 2020 & FEBRUARY 2020, the chart will show JANUARY 2020 + FEBRUARY 2020 values/2. Show value as percent of grand total doesn't work for me because I will need the raw values to be displayed on the chart.

 

yong9lum_0-1606967434662.png

 

Anyone know how I can do this?

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @yong9lum 

 

It’s my pleasure to answer for you.

According to your description,You can create a measure to calculate the desired result.

Like this:

avg = 
VAR a =
    CALCULATE ( SUM ( 'Table'[value] ), ALLSELECTED ( 'Table' ) )
VAR b =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Period] ), ALLSELECTED ( 'Table' ) )
RETURN
    DIVIDE ( a, b )

4.png

 

5.png

Here is my sample .pbix file.Hope it helps.

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @yong9lum 

 

It’s my pleasure to answer for you.

According to your description,You can create a measure to calculate the desired result.

Like this:

avg = 
VAR a =
    CALCULATE ( SUM ( 'Table'[value] ), ALLSELECTED ( 'Table' ) )
VAR b =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Period] ), ALLSELECTED ( 'Table' ) )
RETURN
    DIVIDE ( a, b )

4.png

 

5.png

Here is my sample .pbix file.Hope it helps.

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

amitchandak
Super User
Super User

@yong9lum , with help from a date table and months to be selected from Slicer , Try a measure like the example

 

Avg MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date])) /CALCULATE(Distinctcount('Date'[Date]),DATESMTD('Date'[Date]), not(isblank(Sales[Sales Amount])))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @yong9lum 

 

This is easy, just create below measures.

Measure 1= sum(value)

 

Measure 2= Averagex(values(Period),Measure 1

 

This will work fine, please accept this as solution if this works fine with you.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors