The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have the following measure:
Solved! Go to Solution.
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]
)
)
)
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]
)
)
)
This worked perfectly! I just had to add a filter in the value clause
here is the complete dax query:
@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
)
)
Proud to be a Super User!
This is also not working
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
8 | |
5 |