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
py1029
Frequent Visitor

Calculate the Average for only the Month that have the score

Hi,

 

I'm having a problem when calculating a score for a KPI in Power BI. Below is the table that showing in my dashboard.

The financial year is starting at July. It has the same target (22%) for every month. The Achievement is calculated by using Actual/Target. When I want to calculate the score in a YTD basis, I would like to average the monthly scoring that with scoring only. (0% means there is no scoring for that month)

 

For example, I want the calculation at Nov be like: (27%+18%)/2 = 22.5%  

Currently, I'm using AVERAGE dax function in my measure which will take into account the 0% as well and become (0%+27%+18%+0%+0%)/5 = 9%  and this is not the result that I want.

 

py1029_0-1638347497568.png

Is there anyway I can calculate the average of score (YTD) be like this ? (27%+18%)/2 = 22.5%  

6 REPLIES 6
V-lianl-msft
Community Support
Community Support

Hi @py1029 ,

 

Try to create a measure like below:

average of score = CALCULATE( AVERAGE('Table'[Actual]), FILTER('Table', 'Table'[Actual] <> 0 ))

 

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

Hi, 

I have tried on this measure but it caused a problem that for the Month which have 0% won't be showing out and the column "Actual" in the table visual should be the YTD of it (22.5%) as attached below:

WhatsApp Image 2021-12-08 at 18.14.45 (1).jpeg

WhatsApp Image 2021-12-08 at 18.14.45.jpeg

 

Thanks!

lbendlin
Super User
Super User

I am amazed how often this question comes up.   Please explain the business reasoning behind your expectation.

Hi.

This happened when I want to calculate the Gross Margin for an individual. As there might not have any projects for every month and this concept can be explained as acumulative basis. For example:

py1029_0-1638436266880.png

Thanks!

I still don't get the business case but attached is an implementation.

 

Hi,

Will try on your solution soon. Thanks for the reply!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.