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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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