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
pe2950
Helper I
Helper I

Counting Rows Across Relative Dates, Handling Dates with 0 items?

I'm trying to generate some reports based off an appointment table.

 

1 row in the table represents an appointment. The create timestamp of the appointment is linked to a dateKey table.

 

I have a "count" row in appointment table with the value static at 1; when I'm trying to determine number of appointments scheduled on a given day I just sum all the values of count. 

 

Now, here is where my problem occurs. I have a column chart where I'd like to display "number of appointments created, by day, for the last 7 days"

 

In the report, I have DateKey[Date] as the Axis, and Count as the Value. Then the filter is relative to last 7 days. This works out just fine, except for days where 0 appointments were created. Instead of the count of the rows being 0, the visual just sort of skips the date. This becomes a problem if I try to use a line chart, as instead of graphing down to 0 and then back up, it will skip that date and draw a line between the two non zero values. 

 

Can anyone offer some input on this?

 

 

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @pe2950,

 

Firstly, please change the X-axis type from Categorical to Continuous. Secondly, add below measure to chart value instead of dragging the [Count] column into chart.

Measure = SUM(AppointmentTable[Count])+0

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @pe2950,

 

On the X-Axis option try to change the axis type from Categorical to continuous should give what you need, that is to show the dates without values.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.