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
Anonymous
Not applicable

Cumulative Total of several tables

Hi,

 

I'm working on a project, and I'd like to make a cumulative total with data coming from different tables.

I have been through a lot of forums and tried different techniques but I can't seem to make this work.

Here are the tables I have tables.PNG

All historiques and PBI-Releve are data tables filtered by the calendar table using Date and PBI-ID Table using Attribute (name)

 

The cumulative sum actualy works but doesn't follow the filters on my pagecumulative.PNG

As you can see it's cumulating but from the first date ever, regardless of the year I'm asking (which is from calendar table)

The measure is as follow

Chaud cumulé = CALCULATE([Conso chaud gen],filter(ALLSELECTED('calendar'[Date]),'calendar'[Date]<=max('calendar'[Date]) ))
 
Conso chaud gen = (CALCULATE(sum(Historique2[Value]),filter('PBI-ID','PBI-ID'[Nom compteur]="chaud gen"))+
CALCULATE(sum(Historique1[Value]),filter('PBI-ID','PBI-ID'[Nom compteur]="chaud gen"))+
CALCULATE(sum('PBI-Relevés'[Value]),filter('PBI-ID','PBI-ID'[Nom compteur]="chaud gen")))/1000+
CALCULATE(SUM(HistoricLogs[Conso_1.m3_2.MWh]),FILTER(HistoricLogs,HistoricLogs[TagReference]="vtCompteur2"))
 
HistoricLogs isn't linked to PBIID, only to calendar and by Date as well
 
I Hope I am clear enough, please if anyone has an idea or questions I'll be glad to answer
 
Thanks in advance
 
3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous - It's difficult to follow what might be going on here. Could have something to do with the ALLSELECTED function. Do you really need that? Are you saying it isn't following your filters because it doesn't start at zero?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Hi, 

thanks for you're reply! I don't "need" allSelected it is just something i tried after ALL function and ALLEXCEPT. If you have any other function I would love to try it out !

That's what I'm saying indeed. When I don't apply any filter it starts from 0 and does a cumulative sum. Yet, it is supposed to start from 0 when i choose a time period.

I have data starting 2017, I would like to be able to select 2019 and know exactly how much has been consumed on 019 starting at 0 to see the evolution during the year.

Have a good day

 

Hi @Anonymous ,

 

It is really hard to say what's going on in your measure.Would you please inform us more detailed information( your  data(by OneDrive for Business)) if possible? Then we will help you more correctly.

 

Please do mask sensitive data before uploading.

 

Thanks for your understanding and support.

 

Best Regards,

Dedmon Dai

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.