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

Hi, 

 

I need help to write my cumulative total measure. 

 

I have the column [Beloeb] for my financial items i want to sum from the start date 12-31-2015 and to a given month. The start date must in every situatio be 12-31-2015. The end date should in every situation be the last day of a given month. So if I want to see the total amount for April 2021 the period will be from 12-31-2015 to 04-30-2021. 

 

I have so far tried this, but it does not work:

Total_beloeb =
CALCULATE(
SUM('dm fct_Finansposter'[Beloeb]),
ALL('dm fct_Finansposter'[Beloeb]),
EOMONTH(DATE(2015,12,31),12) <= MAX(DATE(2021,12,31))
)

 

I hope someone can help me, as i really need help to write this function. 🙂

 

Best regards

Line

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hi! 

Add a calendar table with a relationship between your finansposter date column and the calendar table date column. Then try the following measure:

Total_beloeb =
VAR Mdate = MAX('Calendar'[Date])
Return
CALCULATE(
SUM('dm fct_Finansposter'[Beloeb]),
ALL('Calendar'),
'Calendar'[Date]>=DATE(2015,12,31),
'Calendar'[Date]<=mDate
)

Connect on LinkedIn

View solution in original post

2 REPLIES 2
tex628
Community Champion
Community Champion

Hi! 

Add a calendar table with a relationship between your finansposter date column and the calendar table date column. Then try the following measure:

Total_beloeb =
VAR Mdate = MAX('Calendar'[Date])
Return
CALCULATE(
SUM('dm fct_Finansposter'[Beloeb]),
ALL('Calendar'),
'Calendar'[Date]>=DATE(2015,12,31),
'Calendar'[Date]<=mDate
)

Connect on LinkedIn
Anonymous
Not applicable

Thank you for your help, it worked!

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.