National Fuel Market Analysis
Questions:
1. What is the average price of Gasoil Grade 2 across all provinces?
Avg Price Grade2 Gasoil = CALCULATE(AVERAGE(Fact_Table[Price (Arg Pesos)]),Fact_Table[Product ID]=19)
2. Which company has the highest total sales by city?
Total Sales = SUM(Fact_Table[Price (Arg Pesos)])
3. How has the price of Petrol Premium - 95 Octane changed from September 2022 to
October 2023?
Avg price Petrol Premium 95 = CALCULATE(AVERAGE(Fact_Table[Price (Arg Pesos)]),Fact_Table[Product ID]=3)
4. Which region has the highest average price for Compressed Natural Gas?
Avg Price Compressed Natural Gas = CALCULATE(AVERAGE(Fact_Table[Price (Arg Pesos)]),Fact_Table[Product
ID]=6)
5. Can we observe any significant difference in fuel prices between daytime and nighttime
shifts?
Avg Fuel Price by Shift = CALCULATE(AVERAGE(Fact_Table[Price (Arg Pesos)]))
6. What is the price range for Petrol unleaded - 95/98 Octane in the Buenos Aires province?
Min Petrol Price Unleaded Buenos Aires = CALCULATE(MIN(Fact_Table[Price (Arg Pesos)]),Dim_Product[Product
ID]=2,Dim_Sister_Companies[Province]="Buenos Aires")
Max Petrol Price Unleaded Buenos Aires = CALCULATE(MAX(Fact_Table[Price (Arg
Pesos)]),Dim_Product[Product ID]=2,Dim_Sister_Companies[Province]="Buenos Aires")
7. How many different types of products are sold by the company "AUTOMOVIL CLUB
ARGENTINO"?
Distinct Product ACA = CALCULATE(DISTINCTCOUNT(Fact_Table[Product ID]),Dim_Sister_Companies[Company
Name]="AUTOMOVIL CLUB ARGENTINO")
8. Which city in the Patagonia region has the highest recorded price for any fuel type?
Max Price Patagonia = CALCULATE(MAX(Fact_Table[Price (Arg
Pesos)]),Dim_Sister_Companies[Region]="Patagonia")
9. What are the top 10 companies by sales revenue in 2023?
Total Sales 2023 = CALCULATE(SUM(Fact_Table[Price (Arg Pesos)]), Dim_Calendar[Year]=2023)
10. What is the total revenue generated by each flagged company if we assume each price
corresponds to one sale?
Total Sales = SUM(Fact_Table[Price (Arg Pesos)])
11. Which company experienced the greatest percentage change in the price of Gasoil Grade
3 between September 2022 and October 2023?
Percentage_Change_Gasoil3 =
VAR FirstPrice =
CALCULATE(
AVERAGE(Fact_Table[Price (Arg Pesos)]),
Dim_Product[Product Type] = "Gasoil Grade 3",
Fact_Table[Date] >= DATE(2022, 9, 1) &&
Fact_Table[Date] < DATE(2022, 10, 1)
VAR LastPrice =
CALCULATE(
AVERAGE(Fact_Table[Price (Arg Pesos)]),
Dim_Product[Product Type] = "Gasoil Grade 3",
Fact_Table[Date] >= DATE(2023, 10, 1) &&
Fact_Table[Date] <= DATE(2023, 10, 31)
RETURN
IF(
NOT ISBLANK(FirstPrice) && NOT ISBLANK(LastPrice),
DIVIDE((LastPrice - FirstPrice), FirstPrice))
Put Company and measure in a histogram
12. What was the highest and lowest prices of Gasoil Grade 2 in the province of Buenos
Aires during the year 2023?
Lowest_Price_Gasoil_Grade2_BuenosAires = CALCULATE(min(Fact_Table[Price (Arg
Pesos)]),Dim_Product[Product Type]="Gasoil Grade 2", Dim_Sister_Companies[Province]="Buenos
Aires",Dim_Calendar[Year]=2023)
Highest_Price_Gasoil_Grade2_BuenosAires = CALCULATE(max(Fact_Table[Price (Arg
Pesos)]),Dim_Product[Product Type]="Gasoil Grade 2", Dim_Sister_Companies[Province]="Buenos
Aires",Dim_Calendar[Year]=2023)
13. Which month had the greatest profit win in the prices of Petrol unleaded - 95/98 Octane
during the year 2022?
Avg Petrol Unleaded 95/98 2022 = CALCULATE(AVERAGE(Fact_Table[Price (Arg Pesos)]),Dim_Product[Product
ID]=2,Dim_Calendar[Year]=2022)
Profit_Win_Petrol95_98 =
VAR CurrentAvg = [Avg Petrol Unleaded 95/98 2022]
VAR PrevAvg =
CALCULATE(
[Avg Petrol Unleaded 95/98 2022],
PREVIOUSMONTH(Dim_Calendar[Date])
RETURN
IF(
ISBLANK(PrevAvg),
BLANK(),
CurrentAvg - PrevAvg
14. Are there significant correlations between geographical location (latitude and longitude)
and product prices for a specific company?
Plot a scatter chart between average prices longitude and latitude
X-Axis – Longitude
Y-Axis – Latitude
Size – Average Price
Filter the visual by company using a slicer
15. What was the product that showed the highest sales?
Add the total sales and product in a table and sort by descending to get the product with
highest sales.
16. Was there any month in the year 2023 where a trend of increasing prices for all products
sold by a specific company was observed?
Avg. Price by Product = Average(Fuel Prices[Prices])
Prev. Month Price by product = Calculate([use the above dax],DATEADD(‘Datetable’[Date],-
1,MONTH))
Month on Month Change = [Avg Price by product] – [Prev. Month Price by product]
Then add Product on rows, MOM Change as value and month on columns. Filter by company
using slicer and check if Product value is >0 .
17. Which company showed the greatest volatility in the prices of all its products during the
year 2023?
Here we have to use Standard Deviation to measure the volatility.
Price Volatility =
Calculate(
STDEVX.S(Fuel[Date]),Calculate(Average(Fuel[Prices]))),KEEPFILTERS(YEAR(Fuel[Date]) =
2023)
Then please try to put company in rows in a table and price volatility and sort by descending.
The DAX mentioned above is for reference, use actual fact table and dimension table column
names in your file.
The Resources.
1. Excel Spreadsheet with dataset.
Default Calendar DAX
Dim_Calendar =
ADDCOLUMNS(
CALENDAR(MIN(Fact_Table[Date]),MAX(Fact_Table[Date])),
"DateInt",
FORMAT( [Date], "YYYYMMDD" ),
"Year", YEAR( [Date] ),
"MonthNumber", FORMAT( [Date], "MM" ),
"MonthNameShort", FORMAT( [Date], "mmm", "En-us" ),
"MonthNameLong", FORMAT( [Date], "mmmm", "En-us" ),
"DayOfWeekNumber", WEEKDAY( [Date] ),
"DayOfWeek", FORMAT( [Date], "dddd", "En-us" ),
"DayOfWeekShort", FORMAT( [Date], "ddd", "En-us" ),
"Quarter", "Q" & FORMAT( [Date], "Q" ),
"YearQurter", FORMAT( [Date], "YYYY") & "-Q" & FORMAT( [Date], "Q" ),
"YearMonth", FORMAT( [Date], "YYYY" ) & "-" & FORMAT( [Date], "MM" ),
"EndOfMonth", EOMONTH( [Date], 0 )