Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello everyone! I came back again,,,😣
I want to make a table filtered and summary values cumulative,but this doesn't work.How should I correct it?
Ftd_sum :=
VAR tbl =
SELECTCOLUMNS(
FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
"@Trg", 'TEST_'[PN]
)
VAR Dis =
DISTINCT(tbl) // OK
VAR Ftd =
CALCULATETABLE(
'TEST_',
'TEST_'[PN] IN Dis,
FILTER(
ALLSELECTED('Calendar'),
'Calendar'[Date] <= MAX('Calendar'[Date])
),
USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
)
VAR Result =
CALCULATE(
SUM('TEST_'[Qty]),
KEEPFILTERS(Ftd)
)
RETURN
Result
Table (I'm doing it on powerpivot)
want it to be
Thank you for reading,and continuous support!
Best Regards,
Hi @ohnothimagain ,
What about modifying it as shown below?
Ftd_sum :=
VAR tbl =
SELECTCOLUMNS(
FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
"@Trg", 'TEST_'[PN]
)
VAR Dis =
DISTINCT(tbl) // OK
VAR Ftd =
CALCULATETABLE(
'TEST_',
'TEST_'[PN] IN Dis,
FILTER(
ALLSELECTED('Calendar'),
'Calendar'[Date] <= MAX('Calendar'[Date])
),
USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
)
VAR Result =
CALCULATE(
SUM('TEST_'[Qty]),
KEEPFILTERS(Ftd)
)
RETURN
Result
Best regards,
Thank you for your reply!
I tried,but it returned non-cumulative values.do you have any ideas more?