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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Calculate SUM from a calculated measure

Hi,

I am using the measure below to get output as 0 & 1 and now from this output i need to calculate the sum of 0's & 1's.
from a  measure we cant create a SUM right. 
What is the alternative to get sum of 0 & 1 from the Below measure, Any suggestions please?

measure = 

VAR _dCount =
    COUNTROWS (
        FILTER (
            ALL ( 'DB 15092022_1' ),
            'DB 15092022_1'[STO Number] = SELECTEDVALUE ( 'DB 15092022_1'[STO Number] )
                && 'DB 15092022_1'[Index] <= SELECTEDVALUE ( 'DB 15092022_1'[Index] )
        )
    )
RETURN
    IF ( _dCount > 1, 0, 1 )

Thanks
3 REPLIES 3
Anonymous
Not applicable

Hi

I am using the measure below to get output as 0 & 1 and now from this output i need to calculate the sum of 0's & 1's.
from a  measure we cant create a SUM right. 
What is the alternative to get sum of 0 & 1 from the Below measure, Any suggestions please?

measure = 

VAR _dCount =
    COUNTROWS (
        FILTER (
            ALL ( 'DB 15092022_1' ),
            'DB 15092022_1'[STO Number] = SELECTEDVALUE ( 'DB 15092022_1'[STO Number] )
                && 'DB 15092022_1'[Index] <= SELECTEDVALUE ( 'DB 15092022_1'[Index] )
        )
    )
RETURN
    IF ( _dCount > 101 )

Thanks
Greg_Deckler
Community Champion
Community Champion

@Anonymous This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg

Thanks for the quick response.
Here i need to do SUM of the 0's & 1's. Grouping is not  required
any help please?

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.