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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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 MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.