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

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.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

CALCULATE with running filter

hi all,

 

I have a measure like

 

CALCULATE ( Measure, Table2[Category] = "A" )

+ CALCULATE ( Measure, Table2[Category] = "B" )

+ CALCULATE ( Measure, Table2[Category] = "C" )

+ CALCULATE ( Measure, Table2[Category] = "D" )

+ CALCULATE ( Measure, Table2[Category] = "E" )

and so on...

 

Can I write it more compact? With a kind of running Filter?

 

Thanks for ideas.

1 ACCEPTED SOLUTION

Yes, you could do it like

Combined measure =
VAR summaryTable =
    ADDCOLUMNS (
        CALCULATETABLE (
            VALUES ( 'Table2'[Category] ),
            KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" })
        ),
        "@val", [Base Measure]
    )
RETURN
    SUMX ( summaryTable, [@val] )

View solution in original post

3 REPLIES 3
Pikachu-Power
Impactful Individual
Impactful Individual

Thank you it worked 👍

 

The measure dont react to a slicer with A, B and C. Is it also possible to write it in such way that I can also filter it to A, B and C?

Yes, you could do it like

Combined measure =
VAR summaryTable =
    ADDCOLUMNS (
        CALCULATETABLE (
            VALUES ( 'Table2'[Category] ),
            KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" })
        ),
        "@val", [Base Measure]
    )
RETURN
    SUMX ( summaryTable, [@val] )
johnt75
Super User
Super User

You could do something like 

Combined measure =
VAR summaryTable =
    ADDCOLUMNS (
        CALCULATETABLE (
            VALUES ( 'Table2'[Category] ),
            'Table2'[Category] IN { "A", "B", "C" }
        ),
        "@val", [Base Measure]
    )
RETURN
    SUMX ( summaryTable, [@val] )

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.