cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

How to show data with zero count in table when filtering date

I have a date slider in my dashboard.

 

And I have a table visual that contains all products that were sold for a specific date range. (Ex. Products A, B, C, D, E, F).

 

Now when I  do not filter by date, it shows from A-F but when I filter by specific date, products with zero (0) sales will no longer show.

Ex.

No Filter

ProductsSales Count
A5
B3
C2
D1
E1
F5

 

With Date Filter (Products C, and E are not shown)

ProductsSales Count
A5
B3
D1
F5

 

Expected Result (it will still show products with 0 sales count)

ProductsSales Count
A5
B3
C0
D1
E0
F5
1 ACCEPTED SOLUTION
Super User III
Super User III

@tonton I added a date dimension in your model and linked it with your sales table on the date. Added a measure (I think called Count) and on the slicer used Date from the date dimension.

 

As a best practice, you always have a star schema in your model and also must add a date dimension in the model for any date-related calculations.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

11 REPLIES 11
Super User III
Super User III

@tonton I added a date dimension in your model and linked it with your sales table on the date. Added a measure (I think called Count) and on the slicer used Date from the date dimension.

 

As a best practice, you always have a star schema in your model and also must add a date dimension in the model for any date-related calculations.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

I will try this again sir and will let you know

Super User III
Super User III

@tonton solution attached.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi, thank you so much, but what did you do, what's the solution so I can try it on my own. thank you

Super User III
Super User III

@tonton this should be super simple, can you share pbix file, remove sensitive information before sharing, and share thru one drive/google drive.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi parry2k, did you get the chance to look at the pbix that I sent you

hi @parry2k , sent you a personal message with link

Super User III
Super User III

@tonton table here refers to the tables that contain your data (not the table visual), for example, "Sales" or "Orders" or whatever table name is in your model that contains columns.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





yes, i tried using the table (not the visual), but it doesnt work, it just counts the rows, same as my number of sales column. But still the same issue occurs where in, products with ZERO sales do not appear 

 

ProductsSales Count
A5
B3
D1
F5

 

Super User III
Super User III

@tonton create a measure and use this in table visual

 

 

Count = COUNTROWS ( Table ) + 0

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

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.

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Thanks for this. What's the 'table' you are referring to?

 

the "table" in my post refers to the table visuals in power bi

tonton_0-1611119859920.png

 

 

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors