The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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?
User | Count |
---|---|
15 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |