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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cleytonp
Frequent Visitor

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 

 

cleytonp_1-1637350575700.png

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @cleytonp 

You can try this,

(1) create a calendar table

Calendar = CALENDAR(DATE(2021,11,1),DATE(2021,11,6))

vxiaotang_0-1637656706810.png

(2) create the measure when there's no relationship between the 2 tables,

Measure = CALCULATE(MAX('Table'[value]),'Table'[date]=MAX('Calendar'[Date]))

vxiaotang_1-1637656763900.png

Kindly note: don't forget to select show items with no data

vxiaotang_2-1637656808145.png

 

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.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @cleytonp 

You can try this,

(1) create a calendar table

Calendar = CALENDAR(DATE(2021,11,1),DATE(2021,11,6))

vxiaotang_0-1637656706810.png

(2) create the measure when there's no relationship between the 2 tables,

Measure = CALCULATE(MAX('Table'[value]),'Table'[date]=MAX('Calendar'[Date]))

vxiaotang_1-1637656763900.png

Kindly note: don't forget to select show items with no data

vxiaotang_2-1637656808145.png

 

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.

Gabriel_Walkman
Continued Contributor
Continued 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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.