The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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):
Center | Date | Consumption | Invoice total paid | Type of cons. |
A | 01/07/2023 | 14500 | 17800€ | Electricity |
A | 01/07/2022 | 15700 | 19000€ | Electricity |
A | 01/07/2023 | 1400 | 5600€ | Water |
A | 01/08/2023 | 1450 | 5738€ | Water |
B | 01/07/2023 | 17800 | 23000€ | Electricity |
B | 01/08/2022 | 18560 | 18560€ | 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.
This looks straightforward.
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
124 | |
111 | |
78 | |
78 |