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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Dealing with missing rows in underlying data, and adding 0 values

To put it simply our database is calculating 40 metrics for thousands of projects on a daily basis. Each row in the database has project ID, metric type, value, and date. To save on performance our database doesn't store rows if the metric calculated is 0, however, the metric being 0 is actually an important insight, and something we want to display in reports. 

 

The issue I'm having is that I'm unable to satisfactorily display the table visual, and specifically the totals row. I can use a measure to display 0 if the metric is missing, no problem. However, a really important piece of these metrics is displaying their average score across the projects which I use the totals row for, and this is where the crux of the issue lies.

 

If I use a measure to display 0, the average won't take into account those 0's added by the measure and simply display an average of the metrics which have values >0.

 

Would really really love some help on this, and you'd be my hero!

 

I have created these three simplified tables below to give you better feel for the issue. 

1. First table shows which data is stored in the database

2. Second table shows how I want to display data in report view

3. Third table shows how I have tried to solve the problem unsucccesfully

 

How underlying data comes in

Project IDMetricDate
110May
3123May
512May
662May
115June
260June
523June
613June

 

How I want to display data with the average taking into account zeros

Project IDMetric
112.5
230
361.5
40

5

17.5
637.5
Avg26.5

 

 

How I have been displaying data with wrong average

Project IDMetric
112.5
260
3123
40 (added by measure)

5

17.5
637.5
Avg39.75

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

15 REPLIES 15

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors