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
Hi everyone!
I am struggling with a difficult problem. I have a fact table with 2 dates: Task Start Date and Task End Date. I have another dimension table (calendar table) with 2 inactive relationships between these 2 dates and calendar date. In calendar table I have information about Year and month.
How to calculate it in dax? I have tried with something using selectedvalue(calendar[year]), selectedvalue(calendar[month]) and combine it with these 2 dates, but it is incorrect. 1 should be inserted if calendar Year and calendar Month match to Year and Month these 2 dates.
Solved! Go to Solution.
Hi @Anonymous
please use
=
VAR MaxDate =
MAX ( 'Calendar'[Date] )
VAR MinDate =
MIN ( 'Calendar'[Date] )
RETURN
SUMX (
TableName,
IF ( TableName[StartDate] <= MaxDate && TableName[EndDate] >= MinDate, 1 )
)
Hi @Anonymous
please use
=
VAR MaxDate =
MAX ( 'Calendar'[Date] )
VAR MinDate =
MIN ( 'Calendar'[Date] )
RETURN
SUMX (
TableName,
IF ( TableName[StartDate] <= MaxDate && TableName[EndDate] >= MinDate, 1 )
)
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.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 7 | |
| 7 | |
| 7 |