Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 )
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |