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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mlsx4
Super User
Super User

Calculate unit price by supply

Hi all!

 

This must be an easy question to solve, but I'm not clear today and I'm a bit stuck on this.

I have some rows with the consumption for a lot of different supplies and the price I had paid for the invoice in € over years.

 

What I want is to define a formula which calculates the unity price I'm paying to make a comparison between years and months. For instance the price of the KWh if I have selected electricity in my slicer.

 

Data is structured in this way (of course I have dim tables for center, dates and type of cons):

 

CenterDateConsumptionInvoice total paidType of cons.
A01/07/20231450017800€Electricity
A01/07/20221570019000€Electricity
A01/07/202314005600€Water
A01/08/202314505738€Water
B01/07/20231780023000€Electricity
B01/08/20221856018560€Electricity

 

I think the calculus must be done with sumx and divide (price/consumption), selectedvalue for type of cons. but I'm struggling with it.

 

Thank you in advance.

2 REPLIES 2
lbendlin
Super User
Super User

This looks straightforward.  

lbendlin_0-1695504903464.png

 

where are you stuck?

Hi @lbendlin 

 

Yes, I got your formula, but total is not correct. Therefore, I was trying to use some kind of sumx

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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