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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Jacklyn
Frequent Visitor

How to calculate Monthly Average Price for different Fuel type

Hello everyone!

I am hoping I could get some help regarding this. I need to create a line chart to show how the fuel price has affected us over the last 2 years, based on our company monthly fuel spend & quantity. We have 3 fuel types, Diesel, 91 Unleaded and Premium. How do I calculate monthly average rate for each fuel type, by using Amount $ / Quantity.

Here is some of the data.

Jacklyn_1-1669885020094.png

 

Thanks!

 

2 REPLIES 2
Mahesh0016
Super User
Super User

Monthly Flue Type Avg =
VAR Total_Amt = CALCULATE(SUM('Table'[2022 Amount (Excl GST)]),ALLEXCEPT('Table','Table'[Fuels]))

VAR Total_Qty = CALCULATE(SUM('Table'[2022 Quantity]),ALL('Table'))

RETURN
DIVIDE(Total_Amt,Total_Qty,0)
Mahesh0016
Super User
Super User

Monthly Flue Type Avg =
VAR Total_Amt = CALCULATE(SUM('Table'[2022 Amount (Excl GST)]),ALLEXCEPT('Table','Table'[Fuels]))

VAR Total_Qty = CALCULATE(SUM('Table'[2022 Quantity]),ALLEXCEPT('Table','Table'[Fuels]))

RETURN
DIVIDE(Total_Amt,Total_Qty,0)

Hi,
I hope above Solution is Helpful, Try It.


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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