Forum Discussion
Slicer / Date Issue
- 1 year ago
Hey there!
Here are a few solutions for you:
1. Since your x-axis is Receipt Date (Month, Year), make sure your dataset has a continuous date table. Power BI needs a proper date table to maintain continuity. Create a Date Table (if you don't have one):
DateTable = ADDCOLUMNS(
CALENDAR(DATE(2023,1,1), DATE(2025,12,31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMM YYYY")
)Go to Modeling → Mark as Date Table → Select Date.
Use This Date Table in Your X-Axis: Instead of Receipt Date from your complaint dataset, use DateTable[Month].Another reason why months disappear is that Power BI does not plot blank values. You can modify your measure to return 0 when no data is available. Try this formula: Complaint_Count =
VAR SelectedComplaints = SELECTEDVALUE(Complaints[ComplaintType])
RETURN
IF(
NOT(ISBLANK(SelectedComplaints)),
COUNT(Complaints[ReferenceNumber]),
0
)This ensures that even when no complaints exist for a given month, Power BI plots 0 instead of removing the month.
Hope this helps!
Cheerio,
Z 😁😁
Hey there!
Here are a few solutions for you:
1. Since your x-axis is Receipt Date (Month, Year), make sure your dataset has a continuous date table. Power BI needs a proper date table to maintain continuity. Create a Date Table (if you don't have one):
DateTable = ADDCOLUMNS(
CALENDAR(DATE(2023,1,1), DATE(2025,12,31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMM YYYY")
)
Go to Modeling → Mark as Date Table → Select Date.
Use This Date Table in Your X-Axis: Instead of Receipt Date from your complaint dataset, use DateTable[Month].
Another reason why months disappear is that Power BI does not plot blank values. You can modify your measure to return 0 when no data is available. Try this formula: Complaint_Count =
VAR SelectedComplaints = SELECTEDVALUE(Complaints[ComplaintType])
RETURN
IF(
NOT(ISBLANK(SelectedComplaints)),
COUNT(Complaints[ReferenceNumber]),
0
)
This ensures that even when no complaints exist for a given month, Power BI plots 0 instead of removing the month.
Hope this helps!
Cheerio,
Z 😁😁
- fionabee1 year ago
Helper I
Hello,
Thank you so much for your speedy response. I have tried your steps in an example sheet but am getting this: