Forum Discussion
Create inexistent data in the matrix.
Hello, I have a matrix that in the columns has the date of each content, however there are contents that do not have the date, for example, 21/11. I don't have this date in my database, how could I create non-existent dates?
Anonymous
Hi Anonymous
You can try this,
(1) create a calendar table
Calendar = CALENDAR(DATE(2021,11,1),DATE(2021,11,6))(2) create the measure when there's no relationship between the 2 tables,
Measure = CALCULATE(MAX('Table'[value]),'Table'[date]=MAX('Calendar'[Date]))Kindly note: don't forget to select show items with no data
Besides, you can also create a relationship between the 2 tables by date column, in this scenario, you don't need to create the measure to get the value. You can directly put date column from calendar table and value column from another table into the same matrix.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- Gabriel_WalkmanContinued Contributor
It is best practice to always use a separate Calendar table. By making a relationship from a Calendar table to your tables, and using the values in the Calendar table in your visual, you can have empty months displayed.
https://docs.microsoft.com/en-us/power-bi/guidance/model-date-tables - v-xiaotangCommunity Support
Hi Anonymous
You can try this,
(1) create a calendar table
Calendar = CALENDAR(DATE(2021,11,1),DATE(2021,11,6))(2) create the measure when there's no relationship between the 2 tables,
Measure = CALCULATE(MAX('Table'[value]),'Table'[date]=MAX('Calendar'[Date]))Kindly note: don't forget to select show items with no data
Besides, you can also create a relationship between the 2 tables by date column, in this scenario, you don't need to create the measure to get the value. You can directly put date column from calendar table and value column from another table into the same matrix.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.