Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Cumulative Values combined with non cumulative values in a column -i have a flag column-align

Hi,

I have a numbers colum where cumulative values are combined with non cumulative values

The amounts are flagged. How do i create a numbers column where

If numbers value has flag A then cumulative into new numbers column

if numbers values has flag B the numbers stay the same 

In this case I want to have quarterly cumulated not QTDCapture.PNG

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

You may create a calculated column like below:

Column =
IF (
    Table1[Flag] = "B",
    Table1[Value],
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Flag] = "A"
                && Table1[Date] <= EARLIER ( Table1[Date] )
        )
    )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

You may create a calculated column like below:

Column =
IF (
    Table1[Flag] = "B",
    Table1[Value],
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Flag] = "A"
                && Table1[Date] <= EARLIER ( Table1[Date] )
        )
    )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Regarding:

Column =
IF (
    Table1[Flag] = "B",
    Table1[Value],
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Flag] = "A"
                && Table1[Date] <= EARLIER ( Table1[Date] )
        )
    )
)

If my Date column is in another table, say Table 2, how can i select this table in this function now I can only select Table1 after &&. So the filter needs to look at table1 and table 2

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors