Forum Discussion
Anonymous
2 years agoNot applicable
Matrix to show zero or blank value when row value is missing
dear gurus I have a situation where a matrix (or table) does not show all row combination if an entry is missing. I have a simple table of sales data with Customer, Month and Quantity that re...
- 2 years ago
Hello Anonymous,
Can you please try this:
1. Create a separate Date table. This table should include all dates for the relevant period and not just the dates present in your sales data. Next, create a Master Customer table that lists all customers.
2. Set relationships between your sales data table ('Demand Database') and the newly created Date and Customer tables.
3. Modify your DAX measures as follows, then adjust the Matrix Visual:
Total Sales Current Month = CALCULATE( SUM('Demand Database'[Quantity]), 'Demand Database'[Demand Sub] = "Demand CM", ALL('Date') // Replace 'Date' with your Date table name )Total Sales Selected Month = CALCULATE( SUM('Demand Database'[Quantity]), 'Demand Database'[Demand Sub] = SELECTEDVALUE('Demand Database'[Demand Sub]), ALL('Date') // Replace 'Date' with your Date table name )Should you require any further assistance, please do not hesitate to reach out to me.
Anonymous
2 years agoNot applicable
it looks that adding "ALL(Date)" works - I have already a date table linked with my database. I tried several other "ALL" combinations but none was working correctly.
Thanks