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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mendino
Frequent Visitor

Subtract index numbers from water meters for actual consumption

Hi, Community Power bi

 

I would like to know how to solve the following problem? I have a table with number of days, the month, the year, the name of the various meters (12 in total), as well as its index in m3 of waterPour arriver à mon objectif je dois faire la soustraction par le relevé précédent.

 

Compteur_bi_help.png

In the case that I have a value per month, I can use the following formula by fessant a decrementation of -1 the month:

 

Conso = Table_vrai[Index]-LOOKUPVALUE(Table_vrai[Index];Table_vrai[compteur];Table_vrai[compteur];Table_vrai[Years];Table_vrai[Years];Table_vrai[Month];Table_vrai[Month]-1)

 

 

My problem is when I have multiple values in the month, how can I please?
I'm thinking of a formula that compares the month of the line to the lower month or if condition ?

 

 

Thank you

Regards,

3 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@mendino,

 

You may try to use SUMMARIZE Function to create a calculated table first.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

thank you for your reply.

I found one solution in site power bi.

" Calculate monthly consumption from daily meter reads"
https://community.powerbi.com/t5/Desktop/Calculate-monthly-consumption-from-daily-meter-reads/m-p/16...

I will tried later your solution
 

View solution in original post

Hello, I have find solution

 

Conso Max Atif = Elec[Max actif]-LOOKUPVALUE(Elec[Max actif];Elec[compteurs];Elec[compteurs];Elec[Année];IF(Elec[Mois]=1;2017;2018);Elec[Mois];IF(Elec[Mois]=1;Elec[Mois]+11;Elec[Mois]-1))

 

 

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@mendino,

 

You may try to use SUMMARIZE Function to create a calculated table first.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you for your reply.

I found one solution in site power bi.

" Calculate monthly consumption from daily meter reads"
https://community.powerbi.com/t5/Desktop/Calculate-monthly-consumption-from-daily-meter-reads/m-p/16...

I will tried later your solution
 

Hello

 

 

Help power bi.PNGI have another problem with this solution.
My table to multiple time  value. I have the years 2018 and 2017.

Conso Max Atif = Elec[Max actif]-LOOKUPVALUE(Elec[Max actif];Elec[compteurs];Elec[compteurs];Elec[Year];Elec[Year];Elec[Month];Elec[Month]-1)

I though put function IF

 Elec[Year];Elec[Year]-If(Elec[Year] <2018;+1;0);Elec[Month];Elec[Month]-If(Elec[Month]>2017;+1;0)

I not understant why does not work ?

Please help.

Regards,

Hello, I have find solution

 

Conso Max Atif = Elec[Max actif]-LOOKUPVALUE(Elec[Max actif];Elec[compteurs];Elec[compteurs];Elec[Année];IF(Elec[Mois]=1;2017;2018);Elec[Mois];IF(Elec[Mois]=1;Elec[Mois]+11;Elec[Mois]-1))

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.