Excel 2010 PowerPivot: How do I show items with no data?
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: The Builders
--
Chapters
00:00 Excel 2010 Powerpivot: How Do I Show Items With No Data?
00:55 Accepted Answer Score 5
01:34 Answer 2 Score 0
02:24 Answer 3 Score 0
02:44 Answer 4 Score 0
02:52 Thank you
--
Full question
https://superuser.com/questions/651102/e...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#microsoftexcel #microsoftexcel2010 #pivottable #powerpivot #dax
#avk47
ACCEPTED ANSWER
Score 5
Actually this is a better solution. Thanks to Alberto Ferrari for this one.
You need to build a Months table (ie a list of month names, Jan/Feb/Mar etc - a linked table will work just fine), and create a relationship between your new Months table and your fact table.
Then write a measure like this one:
NeverBlankUnits:=IF( ISBLANK( SUM(FruitSales[Units]) )
, 0
, SUM(FruitSales[Units])
)
EDIT: When you add your new months column into your pivot table, you may find the default sort is frustratingly alphabetical; Apr, Aug, Dec, Feb... Here's a great tutorial showing you how to get round this.
ANSWER 2
Score 0
A workaround might be possible to use a Data Analysis Expression (DAX) to replace blanks with zeroes.
DAX can force a zero instead of a blank whenever no data exists in the fact table but you want the row to appear in the PivotTable.
For a simple worksheet with Depts, Divisions and a fact table called Numbers, and with a single column "D" containing a number to sum, write the DAX code in this way:
=IF (
COUNTROWS (Divisions) > 0;
IF (ISBLANK (SUM (Numbers[D])), 0, SUM (Numbers[D]))
)
For more information see :
How to Use DAX in Excel's PowerPivot Add-In
Data Analysis Expressions (DAX) in PowerPivot
This approach was originally suggested in the thread Show Items With No Data on Rows.
ANSWER 3
Score 0
A brute force method would be to create a measure for each month. As long as one of the month columns has some data, all month columns will appear. Creating all these individual measures is very tedious though - not ideal.
=CALCULATE(
SUM([Units])
,Filter('FruitSales',[Month Name]="August")
)
ANSWER 4
Score 0
this works for me:
=if(sum(calender[Date])>0;if(isblank(sum(Sales_SalesOrderDetail[LineTotal]));0;sum(Sales_SalesOrderDetail[LineTotal])))