Forum Discussion
Question to identify discrepancies
- 1 year ago
You've posted this in the Power Query section so here's a PQ offering:
If a date doesn't appear in the Date slicer, no-one's placed any orders.
re: "I want to see that customer 1 did not make an order etc etc"
If you're not bothered about the customer name then a direct pivot from the Orders table is possible; see pivot at cell H27.
The workbook: https://app.box.com/s/qqgqq8hwpfz8gickojhdhftsay70cdo1
Hi Babycakes_00 ,Thank you for reaching out to Microsoft Fabric Community Forum.
If you want to create a report that shows all customers with the date they placed an order, and you want to be able to filter by a specific date (e.g., 1/7/2024) to see if each customer has placed an order on that date, try this:
- Let’s assume you have two tables:
(Table1) Customers & (Table2) Orders
Customers: Contains Customer ID, Customer Name, Address, etc.
Orders: Contains Customer ID, Order Date, Product, Quantity, etc.
- Ensure there's a relationship between the Customer ID in the Customers table and the Customer ID in the Orders table. If not, create a relationship.
- You might want to have a dedicated date table to help with filtering. If you don’t have one, create a Date table:
DateTable = CALENDAR(MIN(Orders[Date]), MAX(Orders[Date]))
- Make sure you relate this Date table to the Orders table using the Order Date.
- let's create a measure that will check whether a customer has placed an order on the selected date.
Order on Selected Date =
VAR SelectedDate = SELECTEDVALUE(DateTable[Date])
VAR CustomerOrder =
CALCULATE(
MAX(Orders[Date]),
Orders[Date] = SelectedDate
)
RETURN
IF(ISBLANK(CustomerOrder), BLANK(), CustomerOrder)
- Add a Table visual report to your visual.
- Add Customer Id, Customer Name & the measure to the fields of table visual.
- Add a Date slicer to filter by the date you want. When you select a specific date, the table will update to show All customers, The order date for those who placed an order on that date, The order date for those who placed an order on that date.
- Your output will be something like this:
|
Customer ID |
Customer Name |
Order on Selected Date |
|
1 |
Bob |
1/7/2024 |
|
2 |
Lisa |
(Blank) |
|
3 |
Ted |
1/7/2024 |
|
3 |
John |
1/7/2024 |
If you think this post helps, please mark it as Accept as Solution, so others with similar queries may find it more easily.