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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jj14x
Advocate I
Advocate I

Build summary visualization showing orders completed/issued in given week

Hi,

    I'm relatively new to Power BI, so I'm hoping there is an easy solution to this request.

I have a set of 5 similar tables - each table is for a specific product, and will have at least the following columns

  • Order Request Received Date (this is the date we recieved the request from client)
  • Order#
  • Order Create Date (the date when the order was created based on request from client)
  • Current Order Status (In Progress/Completed/Canceled)
  • Order Completed Date (the date when order was completed)

(there are other columns too, but some of those will vary between the 5 tables)

 

I need to build a summary visualization (preferably a single one that has data for all 5 tables, but if not, we can live with 5 separate visualizations), that shows the following

  • Week Ending date 
  • Number of requests received (In table, look for records that have "Order Request Received Date" for that week ending)
  • Number of orders issued (In table, look for records that have "Order Create Date" for that week ending)
  • Number of orders completed  (In table, look for records that have "Order Completed Date" for that week ending)
  • Number of orders in progress  (In table, look for records that have ("Order Create Date" <= "Week Ending Date", and "Order Completed Date" >="Week Ending Date" minus 7 calendar days) <-- this logic may need to be tweaked, but it can be done.

 

The question:

 

If I needed to get the count of orders issued, I can just create a matrix visualation that would count number of records by the week/ending of order create date. But given that I want the same visualization to show the count of orders completed in that week, how do I go about creating that (since the count of number of records now has to look at week/ending for order completion date)?

 

 

 

 

1 ACCEPTED SOLUTION

Personally I would add a custom column to each table in the query editor with the name of the product, then append all tables into one.  Any columns that don't exist across tables will have "null" values or blank for the tables where that column didn't exist.  Then, I would also create a date table that spans the earliest and latest date from this master table. 

 

After you create relationships between the date table and fact table (you will have one active and two passive relationships), you will need to create some measures depending on the relationship.  With the active relationship, you could simply drag the relevant field to the visual and aggregate as a count, but for the inactive relationships you will need to create a measure using the USERELATIONSHIP function as an argument.

 

Learn more about date table:

https://community.powerbi.com/t5/Desktop/Date-Dimension-Table-that-Dynamically-Pulls-Start-and-End-d...

 

Learn more about USERELATIONSHIP:

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

View solution in original post

2 REPLIES 2

Personally I would add a custom column to each table in the query editor with the name of the product, then append all tables into one.  Any columns that don't exist across tables will have "null" values or blank for the tables where that column didn't exist.  Then, I would also create a date table that spans the earliest and latest date from this master table. 

 

After you create relationships between the date table and fact table (you will have one active and two passive relationships), you will need to create some measures depending on the relationship.  With the active relationship, you could simply drag the relevant field to the visual and aggregate as a count, but for the inactive relationships you will need to create a measure using the USERELATIONSHIP function as an argument.

 

Learn more about date table:

https://community.powerbi.com/t5/Desktop/Date-Dimension-Table-that-Dynamically-Pulls-Start-and-End-d...

 

Learn more about USERELATIONSHIP:

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

Thank you! That sounds feasible - I'll try that out. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.