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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jmgobet
Frequent Visitor

Get bug with calculate measure

Here are my data:

Capture A7017.PNG

Here is my tentative

#qty cumul = CALCULATE(SUM('data a7017'[qty]),FILTER(ALLSELECTED('data a7017'[date]),'data a7017'[date] <= MAX ('data a7017'[date])))

 

Capture A7017 cumul.PNG

 

and

Capture A7017 cumul1.PNG

I am trying to cumulative sum over month / year ie:

Capture A7017 expected.PNG

 

So definitely my measure is not correct, someone to give me a help?

Best

JM

2 ACCEPTED SOLUTIONS

As a final post for that thread here is the correct measure

#qte cumul = CALCULATE(
    [#qte]
, FILTER (ALLSELECTED('Datekey'), 'Datekey'[Date] <= MAX ( 'Datekey'[Date] ))
)

View solution in original post

Icey
Community Support
Community Support

Hi @jmgobet ,

 

Glad to hear this problem has been solved. Please accept your reply as the solution. Your contribution is highly appreciated.

 

 

Best Regards,

Icey

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@jmgobet , In case of cumulative, always prefer to have Date table 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

i have done as suggested, it is ok for the sample but not for the database?!?

I have screencasted my screen in order to better explain/

Best

JM

As a final post for that thread here is the correct measure

#qte cumul = CALCULATE(
    [#qte]
, FILTER (ALLSELECTED('Datekey'), 'Datekey'[Date] <= MAX ( 'Datekey'[Date] ))
)
Icey
Community Support
Community Support

Hi @jmgobet ,

 

Glad to hear this problem has been solved. Please accept your reply as the solution. Your contribution is highly appreciated.

 

 

Best Regards,

Icey

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors