Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rahkim
Helper I
Helper I

How to slice table visual for values that don't exist in a range

Greetings!

 

I have two tables in Power BI.  One has Employees with their assigned Customer.  The other table has the Customer, OrderID and Submitted date of the order.  Actually, I have some more fields and other tables (like Customers), but my issue is with trying to have a visual that shows all of the employees, and the number of orders they have with a customer during a date range - including the customers that aren't in the date range.  For example, Employee John has three Customers (A, B, C) assigned to them in the EmployeeCustomer table and Customer A has 3 orders in January, B has 4 in February and C has 0 orders.   I want the report to have date slider and a table visual so that when the user slides the date range to include January and February the table shows:

 

EmployeeCustomerOrder Count
JohnA3
JohnB4
JohnC0

 

If the user selects just January, I would want the table visual to show this:

 

EmployeeCustomerOrder
JohnA3
JohnB0
JohnC0

 

Currently, I can only show if there is an order in the date range.  I want to include customers that don't have an order in the date range.

 

Thanks!

1 ACCEPTED SOLUTION

Hi @rahkim 

 

You could add a Calendar table in your model. Then create relationships Calendar[Date] - Order[OrderDate] (1:*) and EmployeeCustomer[Customer] - Order[Customer] (1:*). And create a measure NumberOfOrder = COUNT('Order'[ID]) + 0 to count the number of orders.

122201.jpg

Kindly let me know if this works.

Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@rahkim , Add +0 to your measure or try this option on customer

ShowItemwithoutdata.JPG

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak,

 

Those didn't work, unfortunately.  Here is the basic table structure:

 

EmployeeCustomer

EmployeeCustomerYear
JohnA2020
JohnB2020
JohnC2020

 

Order

IDCustomerOrderDate
1A1/1/2020
2B2/1/2020
3A1/2/2020

 

If the user drags the slider to Jan 1, then I want the table to look like:

 

EmployeeCustomerOrders
JohnA2
JohnB0
JohnC0

 

If they drag to include Jan 1 - Feb 15 then I want the table to look like this:

EmployeeCustomerOrders
JohnA2
JohnB1
JohnC0

 

I had some success when I just joined based on the year the employee had the customer and the year on the order date.  But if the user dragged the slider from Feb to March, it would not show A has having 0 orders.  It would only show C has having no orders because it was looking at the whole year and not the month/day of the order.

 

Would a lookup of some sort work?  

Hi @rahkim 

 

You could add a Calendar table in your model. Then create relationships Calendar[Date] - Order[OrderDate] (1:*) and EmployeeCustomer[Customer] - Order[Customer] (1:*). And create a measure NumberOfOrder = COUNT('Order'[ID]) + 0 to count the number of orders.

122201.jpg

Kindly let me know if this works.

Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Hi @v-jingzhang 

 

Yes, that seems to work.  I had already started going down that path, but it seemed weird to create a calendar table to do this.  It works though.  Thanks!

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors