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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Measure to Use Average if Value is Blank

Hi,

I am trying to assign points per project and use an estimate for projects with 0 points currently assigned to them.

My data looks like this and I am basically hoping to maybe create a temp table that averages the Points by Priority and then uses that average if the inital point value is blank.      

Is that the best way to do this? I keep getting values that don't seem to make sense and obviously keeping this dynamic would be great as this is a large data set.  Any ideas?

 

The points adjusted I did quickly in Excel to show what the average if would be for the ones with no points.

PriorityProjectPointsPoints AdjustedStatus
1A5                            5.00Completed
2B5                            5.00Completed
3C10                         10.00Completed
1D10                         10.00Completed
2E5                            5.00Completed
3F10                         10.00Completed
1G0                            5.00Open
2H0                            3.33Open
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello, lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@Anonymous .I am glad to help you.

I hope my test below will give you good advice:
Below is my test data:

vjtianmsft_0-1729057041489.png
The measure I created:

 

M_PointsAdjusted =
VAR _priority =
    MAX ( 'Table'[Priority] )
VAR _avgifblank =
    CALCULATE (
        AVERAGE ( 'Table'[Points] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Priority] = _priority )
    )
VAR _points =
    MAX ( 'Table'[Points] )
RETURN
    IF ( _points = BLANK () || _points = 0,
 _avgifblank, _points )

 

_priority: Get the priority of the current row.
_avgifblank: Calculates the average score of the current priority, filtering out all other priority rows.
_points: Get the score of the current row.
RETURN: Returns the average score if the current row's score is null or zero; otherwise returns the current row's score.

vjtianmsft_1-1729057193890.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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

7 REPLIES 7
Anonymous
Not applicable

Hello, lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@Anonymous .I am glad to help you.

I hope my test below will give you good advice:
Below is my test data:

vjtianmsft_0-1729057041489.png
The measure I created:

 

M_PointsAdjusted =
VAR _priority =
    MAX ( 'Table'[Priority] )
VAR _avgifblank =
    CALCULATE (
        AVERAGE ( 'Table'[Points] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Priority] = _priority )
    )
VAR _points =
    MAX ( 'Table'[Points] )
RETURN
    IF ( _points = BLANK () || _points = 0,
 _avgifblank, _points )

 

_priority: Get the priority of the current row.
_avgifblank: Calculates the average score of the current priority, filtering out all other priority rows.
_points: Get the score of the current row.
RETURN: Returns the average score if the current row's score is null or zero; otherwise returns the current row's score.

vjtianmsft_1-1729057193890.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,@Anonymous .Thank you for your reply.
Try to use sumx to the measure.

vjtianmsft_0-1729818352920.png

M_PointsAdjustedChanged = 
VAR _total=SUMX('Table',[M_PointsAdjusted])
RETURN _total
Anonymous
Not applicable

This is really awesome and works great.  Thanks so much 

Anonymous
Not applicable

Hi,@Anonymous .Thank you for your reply.
You are welcome.

Anonymous
Not applicable

Hi, one quick twist.....

If you wanted the total to be the sum of the points and not the average, is that possible? I am guessing it is a sumx of the average but can't seem to get it to work.

Thanks

Anonymous
Not applicable

The motivation behind it is that I am analyzing 1000's of projects and some of them close same day or have missing dates and there are others that actually have data that I need to present(lasting weeks, months or even years).  Obviously these skew metrics so I was hoping to present some metrics both with and without these zeroes.  

 

Hopefully that hleps but I would also use it for customers who pay on time versus people that take longer. Most customers pay within the window so it would be good to know both ways. 

Thanks

lbendlin
Super User
Super User

You would have to volunteer a bit more information regarding your business logic and motivation behind it.  "Averages and blank values" is a rather touchy subject.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors