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
Anonymous
Not applicable

Matrix Column disappears when there is no data in selected date range

Hello!

I'm new here so I apologize if this has been asked & answered before. I did a search and still could'nt resolve it. Saw some solutions but they did not apply for the Date data type 

 

I have  a matrix with several columns showing number of occurences per month.

For analysis, I use a slider and select a date range say (last 12 months) and I see all the columns.

When I adjust the date range to last 8 months, I need to still see all columns (including blank ones)

However Power Bi hides the blank column. 

I have tried ticking the show items with no dat box - no success .

I also tried creating a column with = IF(ISBLANK('MyTable'[Column_with_DateCount]),0,''MyTable'[Column_with_DateCount])

This did not work for me either.

I have uploaded a document showing what I'm seeing and what I would like to see. Let me know if I need to clarify anything and thanks in advance.

 

Power Bi Query.PNG

 

 

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

You need to create a new measure and a calendar table. The following is my sample you can reference to modify yours.

 

  1. Create a calendar table. (Note: there is no relationship between the two tables.)
Table = CALENDARAUTO()

1.png12.png

 

  1. Create a measure and check the option of show items with no data
Measure = CALCULATE(SUM(financials3[ Sales]),FILTER(financials3,'financials3'[Date] in VALUES('Table'[Date])))

21.jpg22.jpg23.jpg

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-xuding-msft ,

Thank you for your help. Unfortunately it has not worked.

I was able to create the calendar table successfully, however after creating the measure I get the following error:

"The function SUM cannot work with values of type String"

 

I suspect it is because the numbers in my table are counts of events(i.e how many times a site visit was made & Data Type = Date/Time), not values like sales as used in your example.

 

Not sure if this information helps or confuses things but I'm really greatful for your help so far. 

 

Would the measure still work if we used somethig else instead of SUM?

 

Thanks

 

 

Anonymous
Not applicable

To clarify,

What I would like to see is the table with all the columns irrespective of if they are blank or not.

Sorry for the confusion.

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.