Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a project baseline fact table, looks like below. I need to create a measure will will add out the baseline of each project (column [max workdays]) by customer and project responsible person and the filtered yearmonth-1month. The baseline of each project may change over time, so it's important that the measure takes filtered yearmonth into consideration.
Below is the measure I have created. It looks the max(Fact_project_baseline_summarize[max workdays] part doesn't take into consideration the filter() condition I have created. Can someone help? The correct total baseline of customer MBC should be 1181 days.
I have also created a sample power bi file.
https://www.dropbox.com/s/gjmqdzciksqjhqc/Project%20test.pbix?dl=0
****************************************************************
*******************************************************************************************
Solved! Go to Solution.
You need to wrap the MAX in CALCULATE to do the context transition.
total baseline_closed_month2 =
VAR CurrDate = MAX ( Dim_Date[Date] )
VAR PrevMonthStart = EOMONTH ( CurrDate, -2 ) + 1
VAR Baseline_closed_month2 =
SUMX (
FILTER (
Fact_project_baseline_summarize,
Fact_project_baseline_summarize[Baseline_Date] = PrevMonthStart
),
CALCULATE ( MAX ( Fact_project_baseline_summarize[max workdays] ) )
)
RETURN
Baseline_closed_month2
I think you could probably simplify this assuming each project doesn't have more than one row per baseline date.
total baseline_closed_month2 =
VAR CurrDate = MAX ( Dim_Date[Date] )
VAR PrevMonthStart = EOMONTH ( CurrDate, -2 ) + 1
RETURN
CALCULATE (
SUM ( Fact_project_baseline_summarize[max workdays] ),
Fact_project_baseline_summarize[Baseline_Date] = PrevMonthStart
)
You need to wrap the MAX in CALCULATE to do the context transition.
total baseline_closed_month2 =
VAR CurrDate = MAX ( Dim_Date[Date] )
VAR PrevMonthStart = EOMONTH ( CurrDate, -2 ) + 1
VAR Baseline_closed_month2 =
SUMX (
FILTER (
Fact_project_baseline_summarize,
Fact_project_baseline_summarize[Baseline_Date] = PrevMonthStart
),
CALCULATE ( MAX ( Fact_project_baseline_summarize[max workdays] ) )
)
RETURN
Baseline_closed_month2
I think you could probably simplify this assuming each project doesn't have more than one row per baseline date.
total baseline_closed_month2 =
VAR CurrDate = MAX ( Dim_Date[Date] )
VAR PrevMonthStart = EOMONTH ( CurrDate, -2 ) + 1
RETURN
CALCULATE (
SUM ( Fact_project_baseline_summarize[max workdays] ),
Fact_project_baseline_summarize[Baseline_Date] = PrevMonthStart
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 70 | |
| 50 | |
| 42 | |
| 40 |