Forum Discussion
Matrix to show zero or blank value when row value is missing
- 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.
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.