Forum Discussion
Slicer not removing dates from visual
I'm having an issue with a couple visuals. I have a measure which counts the amount of "entries":
Cant. Ingresos = COUNTROWS('Altas_2019-2020')+0The 0 at the end I had to use it for the chart to plot the 0 when there is no entries or data in an specific month instead of the line going straight to the next available point. Kind of what happens in this problem: https://community.powerbi.com/t5/Desktop/Plot-zero-when-there-is-no-data-in-line-chart/td-p/506235
Right now the plot looks like this:
Is already plotting 0 for the rest of the year even though it has not even been loaded yet. This I kind of understand why is happening and as a last resource I think I'll just put a filter for the whole page and take out the months that havent been updated yet (it would be an inconvinience because it would requeire for me to manually change that part every month but OK).
The weird thing happens when I use the slicer to select one specific year, if I select 2020 for example this is what it shows:
Everything before and after 2020 goes to 0 instead of just removing it from the chart. Ever since I put the 0 to plot when there is no data is doing this but now I don't know how to fix it and still do what I need it to do.
I would appreciate any suggestion. Thank you in advance.
6 Replies
- parry2k
Super User
yfquirogah because you have plus zero and that's the reason it is showing the value, if you remove +0 it will work.
Check my latest blog post Improve UX: Show Year in Legend When Using Time Intelligence Measures | PeryTUS IT Solutions I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- yfquirogah
Helper I
Yes, I know thats the reason why because since I put it, it started to have this issues, but as I mentioned there it was the only way I found for the graphic to show when there is no entries instead of just skip the value and plot it as if it was a straight line. Is basically this same case, in which I found the +0 solution (https://community.powerbi.com/t5/Desktop/Plot-zero-when-there-is-no-data-in-line-chart/td-p/506235)
- parry2k
Super User
yfquirogah do you have a separate table for a date that you are using on the x-axis? if not then you need to add a date dimension and use that on the x-axis and on the slicer. Link to how to add date dimension to your model.
Check my latest blog post Improve UX: Show Year in Legend When Using Time Intelligence Measures | PeryTUS IT Solutions I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- yfquirogah
Helper I
I have a Calendar table, is connected to the entries table by the date. From the calendar table I'm using the year and month Hierarchy as the x-axis and the year field on the calendar table is the one I used on the slicer.
- AnonymousNot applicable
Hi yfquirogah ,
Could you please share your screenshot of your line chart's field with me? What's the relationship between two tables?
Actually I did a test, but I cannot reproduce your issue. Please check my steps if there is anything different?
ps. I used the same measure as you shared before.
Best Regards,
Yuna
- yfquirogah
Helper I
I had to repost the problem, for some reason I wasnt able to respond to the post until now. Please go to this link https://community.powerbi.com/t5/Desktop/Slicer-not-removing-dates-from-plot/m-p/1693351#M672949 there you can find the .pbix, I was able to reproduce the issue.