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! Learn more
Hi PowerBI Community,
I have an interesting DAX challenge involving the integration of a new Calendar table into an existing model. Here's my scenario:
I have three tables:
Previously, I had a measure that calculated remaining budget amounts for the year based on a date slicer connected directly to TABLE1's date field. The measure worked perfectly. However, after introducing the Calendar table as my master date table (with the slicer now connected to Calendar), the measure returns blank values.
Here's my original working measure (masked for privacy):
Measure_Name =
VAR CurrentDate = MAX(TABLE1[DATE_FIELD])
VAR YearStartDate = DATE(YEAR(CurrentDate), 1, 1)
VAR CurrentMonth = MONTH(CurrentDate)
RETURN
CALCULATE(
SUM(TABLE2[AMOUNT_FIELD]),
FILTER(
CROSSJOIN(
ALL(TABLE1[DATE_FIELD]),
VALUES(TABLE1[CLIENT_ID])
),
MONTH(TABLE1[DATE_FIELD]) > CurrentMonth &&
YEAR(TABLE1[DATE_FIELD]) = YEAR(CurrentDate)
)
)
The measure calculates future month budgets based on the selected date. It worked when the slicer was connected directly to TABLE1[DATE_FIELD], but now that I'm using a Calendar table for date selection, it's not working.
My table relationships are:
How can I modify this measure to work with the Calendar table while maintaining the same calculation logic?
Below is sample data:
Any help would be greatly appreciated!
Solved! Go to Solution.
Hi,
Revise the measure to
measure_column = CALCULATE(SUM(Budget[AMOUNT_FIELD]),DATESBETWEEN('Calendar'[Date],MAX('Calendar'[Date])+1,MAXX(ALL('Calendar'),'Calendar'[Date])))
Hope this helps.
Thanks! Attached is the PBIX file and the measure. The expected result is a measure that once the filter from the calendar table is active returns the sum of the budget from the budget amount field where budget Date > CAlendar date. (i.e. if February is selected in the calendar slicer, the result must be the sum of the budgets from March and April, 384,000)
https://drive.google.com/file/d/1hRrtOCUvIX_uVUj96yBAE0ws2H0IjE9O/view?usp=sharing
Thanks
Hi,
Revise the measure to
measure_column = CALCULATE(SUM(Budget[AMOUNT_FIELD]),DATESBETWEEN('Calendar'[Date],MAX('Calendar'[Date])+1,MAXX(ALL('Calendar'),'Calendar'[Date])))
Hope this helps.
Thanks! It's working now.
You are welcome.
Hi again! I missed one thing - the relationship between the tables. I've updated the PBIX file to reproduce the same error
https://drive.google.com/file/d/1hRrtOCUvIX_uVUj96yBAE0ws2H0IjE9O/view?usp=drive_link
I created measure_field2 using the code you sent me and I'm using the Power BI functionalities I need (Single Date picker and Top n 1 ordered by date), but the code you provided isn't returning the expected results. The relationship must remain as it is currently configured, which is why I cannot implement it differently. I've tried modifying it, but doing so breaks my report.
Could you provide additional guidance considering this table relationship structure?
If you insist on that relationship staying intact then i will not be able to help you because tht relationship should not exist in the first place.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.