Some Imp Scenario Q & A for product based Company :
You are a data analyst at a logistics company. The company wants to analyze delivery performance and customer satisfaction. Your tasks are:
1. Identify late deliveries and their impact on customer satisfaction.
2. Calculate the average delivery time for each region.
3. Create a Power BI report to visualize delivery performance and identify areas for improvement
Answer:
SQL Queries to Retrieve Data
1. Identify Late Deliveries and Their Impact on Customer Satisfaction:
SELECT
d.DeliveryID,
d.CustomerID,
d.DeliveryDate,
d.ExpectedDeliveryDate,
d.DeliveryTime,
c.SatisfactionScore
FROM Deliveries d
JOIN Customers c ON d.CustomerID = c.CustomerID
WHERE d.DeliveryDate > d.ExpectedDeliveryDate;
2. Calculate the Average Delivery Time for Each Region:
SELECT
Region,
AVG(DATEDIFF(day, OrderDate, DeliveryDate)) AS AvgDeliveryTime
FROM Deliveries
GROUP BY Region;
3. Customer Satisfaction by Delivery Performance:
SELECT
DeliveryPerformance,
AVG(SatisfactionScore) AS AvgSatisfactionScore
FROM (
SELECT
d.CustomerID,
c.SatisfactionScore,
CASE
WHEN d.DeliveryDate <= d.ExpectedDeliveryDate THEN 'On Time'
ELSE 'Late'
END AS DeliveryPerformance
FROM Deliveries d
JOIN Customers c ON d.CustomerID = c.CustomerID
) AS DeliveryData
GROUP BY DeliveryPerformance;
Import Data into Power BI
1. Load Data:
Open Power BI Desktop.
Use the "Get Data" feature to connect to your SQL database.
Import the result sets from the SQL queries into Power BI.
2. Create Relationships (if necessary):
Ensure that the data tables are properly related, such as linking the Deliveries table to the Customers table.
Create Visualizations
1. Late Deliveries and Their Impact on Customer Satisfaction:
Create a table visual.
Drag DeliveryID, CustomerID, DeliveryDate, ExpectedDeliveryDate, DeliveryTime, and SatisfactionScore to the Values.
2. Average Delivery Time for Each Region:
Create a bar chart.
Drag Region to the Axis.
Drag AvgDeliveryTime to the Values.
3. Customer Satisfaction by Delivery Performance:
Create a bar chart.
Drag DeliveryPerformance to the Axis.
Drag AvgSatisfactionScore to the Values.
4. Overall Delivery Analysis:
Create a pie chart.
Drag Region to the Legend.
Drag AvgDeliveryTime to the Values.
Optimize Performance
1. Data Model Optimization:
Filter data to include only necessary columns and rows.
Use summarized tables to pre-aggregate data.
2. DAX Optimization:
Create measures for dynamic calculations.
Simplify DAX formulas to improve performance.
3. Visualization Optimization:
Limit the number of visuals per page.
Avoid excessive use of slicers or custom visuals that can impact performance.
I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Like if it helps :)
Post #776
1.89K
- 🥰 2