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
AishwariyaV
Helper IV
Helper IV

Half year cumulative sum dax

Hi guys,

I have a scenario where i have to calculate cumulative sum for half year. I have used the below dax

VAR LatestDate = calculate(MAX(Facttable[Entered Date]),Facttable[Origin]="Actuals")
Var maxfischalf = CALCULATE(MAX(Facttable[Fiscal Half]),Facttable[Origin]="Actuals")

VAR Filter1 =
FILTER(
ALL('Calendar Date'[Date]),
'Calendar Date'[Date] <= LatestDate
)
VAR Filter2 =
FILTER(
ALL('Calendar Date'[Fiscal Half]),
'Calendar Date'[Fiscal half] = maxfischalf
)

VAR saleshtd = CALCULATE(
SUM(Facttable[sales]),Facttable[Origin]="Actuals",Filter1,Filter2)

RETURN
saleshtd

 

Here 1st half year will be considered from april to sep and will be categorised as 'A' and the second half will be from october to march and categorized as 'B'. For eg, from april 2021 to sep 2021, the fiscal half is '21A' and from oct 2021 to march 2022, the fiscal half is '21B'.

So the above formula works well till current date(Feb 2022), but when march 2022 in filter is selected, the dax should display the values till feb 2022. That is, it should be cumulative from oct 2021 to march 2022, even when there is no data for march 2022.

Oct-211
Nov-212
Dec-213
Jan-224
Feb-225
Mar-22 

Consider this is the format, when march 2022 is filtered it shows 0/blank, instead it has to show 15.

 

Need some help here

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @AishwariyaV ,

 

Please show some sample data so that we could test the formulas.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@AishwariyaV , Please refer my video on use half year till date from there

 

Half Year Time Intelligence, Half Year Till date: https://youtu.be/fkm3Xvjcpl0

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.