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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.