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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
hungbm1
New Member

SUMX problem

I had a problem while using SUMX.

I need to count the number of project that start in November, but the total is wrong (as the image bellow).

I'm so confuse =((

 

hungbm1_0-1670776288134.png

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @hungbm1 

You're missing context transition. Please try

Number of new project =
SUMX (
    DISTINCT ( D_Project[Project Code] ),
    CALCULATE (
        VAR Start_of_period =
            MIN ( 'Calendar'[Date] )
        VAR End_of_period =
            MAX ( 'Calendar'[Date] )
        VAR Start_date_of_project =
            SELECTEDVALUE ( D_Project[Plan Start date (65)] )
        RETURN
            IF (
                Start_of_period <= Start_date_of_project
                    && Start_date_of_project <= End_of_period,
                1,
                0
            )
    )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @hungbm1 

You're missing context transition. Please try

Number of new project =
SUMX (
    DISTINCT ( D_Project[Project Code] ),
    CALCULATE (
        VAR Start_of_period =
            MIN ( 'Calendar'[Date] )
        VAR End_of_period =
            MAX ( 'Calendar'[Date] )
        VAR Start_date_of_project =
            SELECTEDVALUE ( D_Project[Plan Start date (65)] )
        RETURN
            IF (
                Start_of_period <= Start_date_of_project
                    && Start_date_of_project <= End_of_period,
                1,
                0
            )
    )
)

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric 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.

Users online (25)