Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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-21 | 1 |
| Nov-21 | 2 |
| Dec-21 | 3 |
| Jan-22 | 4 |
| Feb-22 | 5 |
| 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
Hi @AishwariyaV ,
Please show some sample data so that we could test the formulas.
Best Regards,
Jay
@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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |