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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.