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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Swiya
Frequent Visitor

SUMX is not showing calculating any totals

I have the following measure:

1. Project Load =
var result = CALCULATE(SUMX(SUMMARIZE(Project,Project[Project Number]),SUM(Project[Project Value])),ALL('Month Table with weeks'))
return result
2. monthly_project_value =
CALCULATE(
    sumx(
        FILTER('Month Table with weeks',
                DATE(YEAR(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), 1) <= MIN('Month Table with weeks'[First day of Month])
                &&
                DATE(YEAR(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), 1) >= MAX('Month Table with weeks'[First day of Month]
                )
            ),
[Project Load]
    )
)

The filter is used to get the project value for a selected month if the project is live during that month else to not show anything. Although the individual rows are coming correctly but the total is not getting calculated and shows empty.
Swiya_0-1742278893786.png

 

1 ACCEPTED SOLUTION
Deku
Super User
Super User

Wrapped your measure in a SUMX, so we iterate each of the projects like you have in the table, and the total sums all those values

SUMX(
   VALUES( Table[project number],  
CALCULATE(
    sumx(
        FILTER('Month Table with weeks',
                DATE(YEAR(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), 1) <= MIN('Month Table with weeks'[First day of Month])
                &&
                DATE(YEAR(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), 1) >= MAX('Month Table with weeks'[First day of Month]
                )
            ),
[Project Load]
    )
)
)

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
Deku
Super User
Super User

Wrapped your measure in a SUMX, so we iterate each of the projects like you have in the table, and the total sums all those values

SUMX(
   VALUES( Table[project number],  
CALCULATE(
    sumx(
        FILTER('Month Table with weeks',
                DATE(YEAR(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), 1) <= MIN('Month Table with weeks'[First day of Month])
                &&
                DATE(YEAR(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), 1) >= MAX('Month Table with weeks'[First day of Month]
                )
            ),
[Project Load]
    )
)
)

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Swiya
Frequent Visitor

This worked perfectly! I just had to add a filter in the value clause

here is the complete dax query:

SUMX(
   CALCULATETABLE(VALUES( project[project number]),all('Month Table with weeks')),  
CALCULATE(
    sumx(
        FILTER('Month Table with weeks',
                DATE(YEAR(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project Start]), ALL('Month Table with weeks'))), 1) <= MIN('Month Table with weeks'[First day of Month])
                &&
                DATE(YEAR(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), MONTH(CALCULATE(MIN(Project[Project End]), ALL('Month Table with weeks'))), 1) >= MAX('Month Table with weeks'[First day of Month]
                )
            ),
[Project Load]
    )
)
)
manikumar34
Solution Sage
Solution Sage

@Swiya 
monthly_project_value =
SUMX (
VALUES ( 'Month Table with weeks'[First day of Month] ), -- Ensures row-wise calculation
VAR MinStartDate = CALCULATE ( MIN ( Project[Project Start] ), ALL ( 'Month Table with weeks' ) )
VAR MaxEndDate = CALCULATE ( MIN ( Project[Project End] ), ALL ( 'Month Table with weeks' ) )
RETURN
IF (
DATE ( YEAR ( MinStartDate ), MONTH ( MinStartDate ), 1 ) <= MIN ( 'Month Table with weeks'[First day of Month] )
&&
DATE ( YEAR ( MaxEndDate ), MONTH ( MaxEndDate ), 1 ) >= MAX ( 'Month Table with weeks'[First day of Month] ),
[Project Load], -- Use your existing measure for the project value
BLANK () -- Hide values if the project is not live in that month
)
)





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




This is also not working

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.